UTC Date format

Hi All,
Can we use the getCurrentDateString flow in WmPublic to get the date in UTC format. There is no documentation to say that it supports the UTC format but the service does not give any error if you speciify the timezone as UTC and gives me the same output as I would have got for the GMT time zone. Has anyone had any requirement to get the current date in UTC?

Regards,
Bala

Hi,

U can get UTC format using the same service pub.date:getCurrentDateString…and u need to set its attribute as.

pattern:-- yyyy-MM-dd hh:mm:ss -z

timezone – UTC

and now u run the service u will get the time in UTC format…

bye

How do I make sure it is UTC and not GMT because if I use a different varaible for GMT and try to see the output date and timestamp its the same for GMT as well as UTC. according to what I have read thru there seems to be a 0.9 secs difference between the GMT and UTC

If you are looking for a date in XML schema “dateTime” format you’ll need a different pattern and perhaps a Flow service.

For the “trailingZ” form of the XML schema dateTime format you can use the pattern [COLOR=Blue]yyyy-MM-dd’T’HH:mm:ss.SSS’Z’ IF you want to use the timezone offset form of xml schema dateTime, you’ll need a Flow service to reformat the string in order to place a colon between the hours and minutes portions of the offset from GMT.

Mark
[/COLOR]

1 Like

Just Curious:
Q for Bala: why do you need that differentiation between GMT and UTC??

[URL=“http://people.etango.com/~markm/archives/2004/02/29/gmt_vs_utc.html”]http://people.etango.com/~markm/archives/2004/02/29/gmt_vs_utc.html[/URL]

Thanks Rob. That’s why my question to Bala - “why do you need that differentiation between GMT and UTC??”

Yeah, that’s why I posted the link. For all intents and purposes (unless Bala is doing something that is very specialized) there is no difference.

and how-so-ever specialized the request be, Java (nor webMethods) provides a way to differentiate between the two!!

or for that matter, any other language reading computer clocks!! :wink: And you cant predict or calculate time based on astronomical observations.

Please note that Java returns UTC rather than GMT. (though the terms are interchanged in usage)

from Java Sun Date implementation

[INDENT]Although the Date class is intended to reflect coordinated universal time (UTC), it may not do so exactly, depending on the host environment of the Java Virtual Machine.
…
Most computer clocks are not accurate enough to be able to reflect the leap-second distinction.
[/INDENT]

Some computer standards are defined in terms of Greenwich mean time (GMT), which is equivalent to universal time (UT). GMT is the “civil” name for the standard; UT is the “scientific” name for the same standard. The distinction between UTC and UT is that UTC is based on an atomic clock and UT is based on astronomical observations, which for all practical purposes is an invisibly fine hair to split. Because the earth’s rotation is not uniform (it slows down and speeds up in complicated ways), UT does not always flow uniformly. Leap seconds are introduced as needed into UTC so as to keep UTC within 0.9 seconds of UT1, which is a version of UT with certain corrections applied. There are other time and date systems as well; for example, the time scale used by the satellite-based global positioning system (GPS) is synchronized to UTC but is not adjusted for leap seconds.

Thanks a lot for all the replies but in the end I did find out that Wm does give me the output in UTC / GMT. My client had a specific requirement on storing the date time in UTC format.

Regards,
Bala

Greetings Kapil,
I need to UTC formatted date for user and i need to save it in DB.
he requires UTC DATE an UTC timestamp.
can you please tell how UTC DATE and TimeStamp Looks Like,means to know the format how we need to set and columns to store that in DB.

waiting for your reply.

Regards,
Shaik Karimulla

can you please tell me how can i store date and timestamp in utc format in java