In order to make a particular query, I need to find all record entered since a particular DateTime.
The Query Language I'm using defines the DateTime to be in this format: YYYY-MM-DDThh:mm:ss+hh:mm (ex: 1999-01-01T23:01:01+04:00) YYYY-MM-DDThh:mm:ss-hh:mm (ex: 1999-01-01T23:01:01-08:00)
SimpleDateFormat almost gets me the right format... but the timezone isn't quite right. It doesn't put in the ":" in the timezone.
SimpleDateFormat formatter = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssZ" ); This produces 1999-01-01T23:01:01-0800
I don't think it's possible to get this in one step with SimpleDateFormat. You can get the colon by replacing 'Z' with 'z', but that also gives you a "GMT". I think the best solution would be to just use the SDF with the format you're currently useing, then put the result in a StringBuilder and insert a colon manually. That may seem inelegant, but it works.