Question

fetch current date in JS

Hi Team,

 

I'm looking for a solution where the current date can be fetched from the system in edit page code of a section. 

 

I tried using: 

var today = new Date();

var dd = today.getDate();

 

but is not working. Kindly help

 

Thanks,

Sarika

 

 

 

 

 

 

Like 0

Like

1 comments

Hello Sarika,

 

that seems to be regular JS code which works properly independently from the environment. Could you please specify what is exactly not working? It does not generate a number at all? Or it does generate a wrong one? How exactly are you using later this date?

 

Best regards,

Dariy

Show all comments