0

Why is the date wrong?

I have a customer form

and whenever the contact opts in/out out or leaves the company - It writes an entry into an 'GDPR audit' table

However I have an issue with the date- for example - Both my mac date is showing the currect date my time zone is also correct (Uk London time zone) 

at this moment is it 18th July (time is 12.10pm)

and the date posted is yesterday's date 17th instead of 18th ?

I'm using today() in my script - see line in bold

Can anyone suggest why? \

using web version

 

script 

let xCurrRec := Id;
let xCustID := Custid;
let xCompany := Company;
let xFullName := FullName;
let xEmail := Email;
let xGDPR := GDPR;
let i := (create GDPR);
i.(CustId := xCustID);
i.(Company := xCompany);
i.(FullName := xFullName);
i.(Email := xEmail);
i.(GDPR := xGDPR);
i.(OptDate := today());
if GDPR = 3 then
'Last Known Contact' := FullName;
FirstName := null;
LastName := null;
Email := null
end

cheers

Mel

5 replies

null
    • John_Halls
    • 3 yrs ago
    • Reported - view

    I had the same issue a few days ago! Not checked it out though. What is today() saying in the console?

    Regards John

    • Ninox partner
    • RoSoft_Steven.1
    • 3 yrs ago
    • Reported - view

    What i usaly use is date(now()) to get the right date. I think it has something to do with the location of the server. If that doesn't work, using the new function

    correctedDate(datefield) might convert wrong dates to right ones.

    Steven

    • Mel_Charles
    • 3 yrs ago
    • Reported - view

    Hi John/Steven

    Thank you for the suggestions

    Console Test Result!

    today() gives correct date 19th 

    date(now()) gives correct date 19th

    Following this up immediately running the script iwith

    today() - which gives 18th

    date(now()) also gives 18th 

    Crazy or what!

     

    Steven- I don't know if i am implementing your last suggestion correctly

     

    if I add it into the script like so - get no error but in the other table the OptDate is blank

     

    i.(GDPR := xGDPR);
    i.(OptDate := correctedDate(OptDate));
    if 'GDPR Status' >= 3 then

    etc 

     

    I know I could add + 1 to the computed result in the script but

    that would be like saying\

    2 people of exactly the same weight sit on a set of balance scales and yet the scale does not balance and is dropping to one side. so you add an extra pound to the light side to even the balance up - !

     

    This is what John Harrison did in the 17360's when he was making his first Sea Chronometer (H1) to fix the issue of finding Longitude.

    Ending up with a giant time piece thwith all sorts of added weights and counter weights... but I am digressing (I know !) 

    • Mel_Charles
    • 3 yrs ago
    • Reported - view

    ha ha should say "John Harrison did in the 1730's etc"

    I think 17360 is a bit optimistic!

    • zoranlicinar
    • 3 yrs ago
    • Reported - view

    I have customers in australia entering the dates and they are always 1 day behind what they should be... Do you know how I can fix this?

Content aside

  • 3 yrs agoLast active
  • 5Replies
  • 426Views