Solved

Convert GMT Date/Time with Time Zone

Posted on 2014-04-11
7
952 Views
Last Modified: 2014-04-11
In access query, how do you convert a date/time with time zone in GMT format into standard Eastern GMT.  For example:

ORIGINAL FIELD VALUE
2013-07-25T18:43:01.000Z

UPDATED FIELD VALUE
7/25/2013 2:43 PM


Thanks!
0
Comment
Question by:KANEDA 0149
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 39994696
try:
CDate(Replace(Left("2013-07-25T18:43:01.000Z", InStr(1, "2013-07-25T18:43:01.000Z", ".") - 1), "T", " "))

not pretty but works :-)
0
 
LVL 49

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 39994708
First convert to date/time:

strTime = "2013-07-25T18:43:01.000Z"

datTime = CDate(Left(Replace(strTime, "T", " "), 19))

Then expand to convert to local time:

datTime = DateAdd("h", -4, CDate(Left(Replace(strTime, "T", " "), 19)))

/gustav
0
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 39994750
I forgot the time diff (dateadd) :-)
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Closing Comment

by:KANEDA 0149
ID: 39994757
Thank you Gustav, that worked exactly as I needed.
0
 

Author Comment

by:KANEDA 0149
ID: 39994762
Thank you too COACHMAN99, your original returned 6:43 versus 2:43. Which is the time diff missing.
0
 
LVL 75
ID: 39994802
The Master of Date/Time to the rescue ... !
:-)
0
 
LVL 49

Expert Comment

by:Gustav Brock
ID: 39994940
Thanks!

/gustav
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now