I am writing an application in which I have to capture the current date time in UTC and it to the Header of an image file.
I am using Joda date-time. Now the requirement is to get the current date time in UTC and convert it to byte byte/byte array so that it can be stored as the hexadecimal values in header of image file.
What I have tried so far
DateTime date = new DateTime().withZone(DateTimeZone.UTC).
withChronology(ISOChronology.getInstanceUTC());
It is giving me this output:
2013-06-07T09:25:51.630Z
I dont know why there is T and z there in output.
Now I have to convert it to bytes/bytes array. But I am not getting how to do that.
Any Help?
EDIT: As per the standard I am following they have given an example of result after converion
December 15,2005 at 17:35:19.000 ==> 07D5 0C 0F 11 23 13 0000Hex