ben03 Posted March 28, 2019 Share Posted March 28, 2019 Hi there, I am new to Javascript, and finding displaying date and time confusing. I am using new Date().toLocaleString() ...which is perfect, however I am trying to remove seconds on the end as these are not relevant. How do I achieve this? Thanks Link to comment Share on other sites More sharing options...
justsomeguy Posted March 28, 2019 Share Posted March 28, 2019 You can use the various get methods of the Date object to return the various parts and put them together however you'd like: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date Link to comment Share on other sites More sharing options...
ben03 Posted March 29, 2019 Author Share Posted March 29, 2019 Thanks justsomeguy 👍 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now