Help

Re: Incorrect date and time

1155 1
cancel
Showing results for 
Search instead for 
Did you mean: 
John_B2
6 - Interface Innovator
6 - Interface Innovator

It's currently 19:55 on the 21st december in New Zealand. Why does this calculation return a date of the 20th december and the time as 18:55? Surely it can't be that hard to show the correct date for the country you're in?

John_B2_1-1671563204711.png

 

 

2 Replies 2

Dates and times in formula fields are GMT time, unless you specify otherwise. 

SET_TIMEZONE() by itself does not work unless you nest it inside DATETIME_FORMAT(), MONTH(), YEAR(), etc. 

Instead, use NOW() by itself and set the format options for the formula to specify the “local time”. Not that the time is still likely to be off because NOW() does not update continuously. At best, it updates every 5 minutes or so, but it can also be several hours off. 

Thanks Kuovonne. NOW() would have been the first thing I tried. It doesn't work as it always includes a time and I'm needing to compare dates without the time. My imported dates all have 00:00:00 for time so when comparing them with NOW() or TODAY(), the calculation must first convert the date to the correct timezone and then replace the time with zeros. Hence the following calc :

 

DATEADD(DATETIME_PARSE(YEAR(NOWNZ) & "-" & MONTH(NOWNZ) & "-" & DAY(NOWNZ) & "T00:00:00.000Z"),-13,"h")
where the NOWNZ field is just NOW() and displayed as NZ timezone. I have to do it this was as using NOW() in the calc would of course return GMT time!
Phew! Makes me miss Filemaker!