0

I retrieve server date using javascript using JSLink like:

var currentServerDateTime = new Date(_spPageContextInfo.clientServerTimeDelta);

But I want it into format "dd/mm/yyyy", how can I achieve it?

1

To get the current date time try this code below :

var date = new Date();
var currentServerDateTime = date.format("dd/MM/yyyy");

Hope it will be helpful.

0

If you need to know how many milliseconds have elapsed since 1970, then JavaScript is outstanding. If you need formatted dates, then it can be kind of a pain. I think you'll find that lot's of people turn to other libraries, such as moment.js for this sort of thing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.