Home > Archive > MS Access data conversion > June 2005 > Timestamp to ISO 8601









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Timestamp to ISO 8601
David Shorthouse

2005-06-09, 3:24 am

Hey folks,

Anyone know how to convert a timestamp (e.g. 1/24/2005 12:42:14 PM) to
ISO 8601-compliant. Specifically, I am hoping to convert the default general
date as above to 2005-01-24T19:42:14Z since my timestamps are in MST.

Thanks for any ideas,

Dave

--
____________________
__________
Remove "_SPAM" to reply directly.


John Nurick

2005-06-09, 1:24 pm

Hi Dave,

If your code knows its timezone in terms of hours from Greenwich, I
think that all you need to do is something like this air code:

Dim dtZulu As DateTime
Dim strZulu As String

dtZulu = DateAdd("h", TimeZone, TimeStamp)
strZulu = Format(dtZulu, "yyyy-mm-dd\Thh:mm:ss\Z")

with a bit more fiddling if the timestamp is a string rather than a
date/time value.


On Thu, 9 Jun 2005 01:09:01 -0600, "David Shorthouse"
< davidshorthouse@shaw
_SPAM.ca> wrote:

>Hey folks,
>
> Anyone know how to convert a timestamp (e.g. 1/24/2005 12:42:14 PM) to
>ISO 8601-compliant. Specifically, I am hoping to convert the default general
>date as above to 2005-01-24T19:42:14Z since my timestamps are in MST.
>
>Thanks for any ideas,
>
>Dave


--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
David Shorthouse

2005-06-09, 8:25 pm

Thanks for this, I'll give it a shot.

--
____________________
__________
Remove "_SPAM" to reply directly.
"John Nurick" <j.mapSoN.nurick@dial.pipex.com> wrote in message
news:ba2ha19i74ttu4l
uosr8oh7t6jo300evj0@
4ax.com...
> Hi Dave,
>
> If your code knows its timezone in terms of hours from Greenwich, I
> think that all you need to do is something like this air code:
>
> Dim dtZulu As DateTime
> Dim strZulu As String
>
> dtZulu = DateAdd("h", TimeZone, TimeStamp)
> strZulu = Format(dtZulu, "yyyy-mm-dd\Thh:mm:ss\Z")
>
> with a bit more fiddling if the timestamp is a string rather than a
> date/time value.
>
>
> On Thu, 9 Jun 2005 01:09:01 -0600, "David Shorthouse"
> < davidshorthouse@shaw
_SPAM.ca> wrote:
>
>
> --
> John Nurick [Microsoft Access MVP]
>
> Please respond in the newgroup and not by email.



David Shorthouse

2005-06-09, 8:25 pm

Worked like a charm! For those who might be interested, here's my built
field in a query:

Date Last Modified:
Format(DateAdd("h" ,7,CollectionData!Ti
meStamp),"yyyy-mm-dd\Thh:nn:ss\Z")

Where CollectionData!TimeS
tamp is my timestamp field in another table and 7
is the addition in hours to the timestamp to convert from MST to GMT.

Dave

--
____________________
__________
Remove "_SPAM" to reply directly.
"John Nurick" <j.mapSoN.nurick@dial.pipex.com> wrote in message
news:ba2ha19i74ttu4l
uosr8oh7t6jo300evj0@
4ax.com...
> Hi Dave,
>
> If your code knows its timezone in terms of hours from Greenwich, I
> think that all you need to do is something like this air code:
>
> Dim dtZulu As DateTime
> Dim strZulu As String
>
> dtZulu = DateAdd("h", TimeZone, TimeStamp)
> strZulu = Format(dtZulu, "yyyy-mm-dd\Thh:mm:ss\Z")
>
> with a bit more fiddling if the timestamp is a string rather than a
> date/time value.
>
>
> On Thu, 9 Jun 2005 01:09:01 -0600, "David Shorthouse"
> < davidshorthouse@shaw
_SPAM.ca> wrote:
>
>
> --
> John Nurick [Microsoft Access MVP]
>
> Please respond in the newgroup and not by email.



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com