When I print out a date in javascript it adds GMT-0400 (EDT) to the end of it, is there a way I can cut this off? I’m using
date=Date()
document.write(date)
To get the date and time but I dont want the trailing GMT-0400 (EDT)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
var date = new Date();Dateis a constructor and should be used with thenewkeyword.You can use the Date API to build a string, or one of the various date formatting libraries, or even just manipulate it like a string (since it is):
Also, you really shouldn’t use
document.writefor a bunch of reasons, but I digress since your question was not about that.