About 86 results
Open links in new tab
  1. How do I format a date in JavaScript? - Stack Overflow

    Well, what I wanted was to convert today's date to a MySQL friendly date string like 2012-06-23, and to use that string as a parameter in one of my queries.

  2. Format JavaScript date as yyyy-mm-dd - Stack Overflow

    It sad but it is simpliest way to format js date to string you need. I'm new in js, but in java it is 100 times easier to format date to any format. That is why was thinking there are easier way, but after I tried different solutions I choose this one. Thank you for your answer. –

  3. How to change date format in JavaScript - Stack Overflow

    Dec 31, 2015 · Change Date format using Javascript. 0. Setting up jquery timeago plugin. 1.

  4. How to display a Date object in a specific format using JavaScript?

    Mar 2, 2012 · Use the following JavaScript code to display the date on the year only format. function displayDate(){ var now = new Date(); var year=now.getFullYear(); date.innerHTML=year } window.onload=displayDate;

  5. Javascript format date / time - Stack Overflow

    Aug 20, 2014 · I need to change a date/time from 2014-08-20 15:30:00 to look like 08/20/2014 3:30 pm Can this be done using javascript's Date object?

  6. Get String in YYYYMMDD format from JS date object?

    Jun 18, 2010 · If you don't mind including an additional (but small) library, Sugar.js provides lots of nice functionality for working with dates in JavaScript. To format a date, use the format function: new Date().format("{yyyy}{MM}{dd}")

  7. javascript - Format date with Moment.js - Stack Overflow

    Apr 12, 2013 · May be this helps some one who are looking for multiple date formats one after the other by willingly or unexpectedly. Please find the code: I am using moment.js format function on a current date as (today is 29-06-2020) var startDate = moment(new Date()).format('MM/DD/YY'); Result: 06/28/20

  8. Format a date string in javascript - Stack Overflow

    Jun 12, 2017 · Hello every i have date field of type string with iso format like this: const date = "2017-06-10T16:08:00: i want somehow to edit the string in the following format like this: 10-06-2017 but i'm struggling in achieving this. I cut the substring after the "T" character

  9. Parsing a string to a date in JavaScript - Stack Overflow

    The best string format for string parsing is the date ISO format together with the JavaScript Date object constructor. Examples of ISO format: YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS. But wait! Just using the "ISO format" doesn't work reliably by itself. String are sometimes parsed as UTC and sometimes as localtime (based on browser vendor and version).

  10. date - Current time formatting with Javascript - Stack Overflow

    Feb 1, 2013 · I have a date format function I like to include in my standard library. It takes a format string parameter that defines the desired output. The format strings are loosely based on .Net custom Date and Time format strings. For the format you specified the following format string would work: "dddd h:mmtt d MMM yyyy".

Refresh