Page 1 of 1

US vs European date

PostPosted: Tue Aug 02, 2016 12:35 am
I done some "magic" with the time and date when a event is being moved or re-scheduled. So in the beginning of the Create Edit Delete Event I save the original data and in the end of the script, if a error occur I save the old time.

Its like this in the beginning:
Set Variable [$Time_Start ; Get ( Data::Time_Start ) ]

And this after the error occur:
Set field [ Data::Time_Start ; $Time_Start ]

In the beginning, when the variable being added the Data::Time_Start-felild i have 2016-08-03, therefore the $Time_Start get the same data. But after the set field we have a "?" in the Data::Time_Start.
If i try to use GetAsDate ( $Time_Start ) it also will resault in "?".
If i use the Get ( CurrentDate) function it will give me" 8/2/2016".

Is there a way to change DayBack to handel European styled dates or another smart way to get around this problem.

Re: US vs European date

PostPosted: Tue Aug 02, 2016 4:11 pm
by John Sindelar
Hi Ronny,

If I'm following you correctly, I think you want to capture the timestamp as number fields that you added for DayBack instead of FileMaker's native date fields: when native date fields are set to text (as they sometimes are when captured as variables) they use the date format the FileMaker file was created in. There is no way to reset this formatting outside of cloning the file. And this is why we DayBack uses date-as-numbers instead.

So at the beginning of your script try:

Set Variable [$Time_Start ; Get ( Data::DBk_TimestampStartCalcNum ) ]

And then when you're done...

Set field [ Data::Date_Start ; GetAsDate ( GetAsTimestamp ( GetAsNumber ( $Time_Start ) ) ) ]

Set field [ Data::Time_Start ; GetAsTime ( GetAsTimestamp ( GetAsNumber ( $Time_Start ) ) ) ]

Hope that helps,

John

Re: US vs European date

PostPosted: Tue Aug 02, 2016 10:08 pm
Of corse, getAsNumber, what a livesaver! :)
Thanks for the quick help!

Re: US vs European date

PostPosted: Wed Aug 03, 2016 8:36 am
by John Sindelar
> what a livesaver!

No doubt. =)