Rechercher dans l’assistance

Évitez les escroqueries à l’assistance. Nous ne vous demanderons jamais d’appeler ou d’envoyer un SMS à un numéro de téléphone ou de partager des informations personnelles. Veuillez signaler toute activité suspecte en utilisant l’option « Signaler un abus ».

Learn More

Why would a Date field default to 01/01/1970

  • 4 réponses
  • 2 ont ce problème
  • 706 vues
  • Dernière réponse par the-edmeister

more options

In an App called Act-On I want to edit a date but it defaults to January 01, 1970. A lot of clicks to get to today's date. Any thoughts on why the default or start date would be 1970? Act-On say all fine their end. I get the same result in Firefox, Chrome or IE. Anyone seen something similar? I've cleared Cache etc. Cheers John

In an App called Act-On I want to edit a date but it defaults to January 01, 1970. A lot of clicks to get to today's date. Any thoughts on why the default or start date would be 1970? Act-On say all fine their end. I get the same result in Firefox, Chrome or IE. Anyone seen something similar? I've cleared Cache etc. Cheers John
Captures d’écran jointes

Solution choisie

It's hard to tell from the image whether it is a field or a text label modified by the script that powers the calendar control. If it were a normal input field, I think most likely it would be blank.

JavaScript dates start from 01/01/1970. When I type this into Firefox's Web Console and press Enter:

new Date(null);

I get back this, which is midnight on Jan. 1, 1970:

Date 1970-01-01T00:00:00.000Z

So the script might be accidentally setting that (not very helpful) starting value due to something else being missing -- using a null value instead of the expected value.

Can you give a link to the page?

Lire cette réponse dans son contexte 👍 1

Toutes les réponses (4)

more options

Sounds like a website or app issue. Check with their support.

more options

Solution choisie

It's hard to tell from the image whether it is a field or a text label modified by the script that powers the calendar control. If it were a normal input field, I think most likely it would be blank.

JavaScript dates start from 01/01/1970. When I type this into Firefox's Web Console and press Enter:

new Date(null);

I get back this, which is midnight on Jan. 1, 1970:

Date 1970-01-01T00:00:00.000Z

So the script might be accidentally setting that (not very helpful) starting value due to something else being missing -- using a null value instead of the expected value.

Can you give a link to the page?

more options

Thanks folks .. I think both of you are correct. The Javascript default seems to work for me. Funnily enough I just added a new "Wait" Step to the flow and when I went to choose the exact date, the default was today and not 01/01/1970. The existing Steps still default to 1970 so I've deleted them all and started afresh. Thanks for the answers. Well done.

more options

To add to what Jefferson said, the "beginning" of time (null) or "Epoch" for most computer languages is Thursday, 1 January 1970 at Midnight UTC (Coordinated Universal Time)

https://en.wikipedia.org/wiki/Epoch_%28reference_date%29#Computing https://en.wikipedia.org/wiki/Unix_time