Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Zulu Date / Time Problem

Status
Not open for further replies.

jamason07

IS-IT--Management
Aug 28, 2003
46
US
Here's one for you IFF Then gurus. I have a form that the user fills out which time/date stamps the form using the computers date/time setting. The information needs to be reported in Zulu time. Thus, I have set the [Time] field to calculate with Time()+#05:00:00# to give me Zulu time. However, when the calculation goes past midnight, I need the date to roll to the next day. I've tried this formula in the [Date] field but it doesn't seem to work:

IFF([Time]>#23:59:59#, [Date], [Date]+1)

All this seems to do is change all my dates to the next day, not just the one for the specific record. Suggestions?

Thanks!

Jeffrey
 
Jeffrey
I am wondering about the possibility of having an additional unbound text box which is calculated from your Date field which the user fills out.

If so you could put some code in the After Update event of your Date field, which would make use of the DateAdd function.

For example this would add one day to the date in the YourDate field.
Me.ZuluDate = DateAdd("d", [YourDate], 1)

What you have to do is work out the logic of reading the time in [YourDate] so if the Time is greater than 2 minute to midnight the [ZuluDate] advances 1 day.

Hope that helps point to something useful.

Tom
 
I remember seeing this related thread the other day - see if it helps you any.

thread702-671133
 
I read the thread. I wish I had had that information when I set up this database. I would have set everything to use seconds from 1/1/70. That would have made life easy. I don't if I can go back from here since I have so much data in the tables now. But that will be helpful for future reference. Thanks!
 
How is your date/time stamp recorded? Is it just the time or is the date included in the same field or are they in separate fields?

Paul
 
So to put this all in a new field in your query you could use
MyTimeToZulu:DateAdd("h",5,CDate([DateField] & " " & [TimeField])


That should give you a value you can work with.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top