serkanyersen/date-parse
Tag 1
Parses date strings
  Published by serkanyersen on Tuesday, July 4th, 2017, 5:44:54 AM
  # Date parser This is a simple service that will parse the given date string using moment.js and return a JSON object that looks like this ```json { "formatted": "1983-04-05T00:00:00+00:00", "fromNow": "34 years ago", "toNow": "in 34 years", "timestamp": 418348800000, "daysInMonth": 30, "iso": "1983-04-05T00:00:00.000Z", "object": { "years": 1983, "months": 3, "date": 5, "hours": 0, "minutes": 0, "seconds": 0, "milliseconds": 0 }, "isLeap": false, "isDST": false } ``` ## Params - date: this can be any date string or epoch time you want, you can provide the format for this value - fromFormat: This is where you tell the system what format your date is, you can omit this for standart formats. If you want to use unix time stamps, you need to send `epoch` with this param, if your timestamp contains milliseconds then it needs to be `epoch-ms`. otherwise moment.js will not understand your date - toFormat: this is the format you want your output in. you can check moment.js documentation to see all format fields that you can use. ## Examples - only date provided https://serkanyersen.lib.id/date-parse/?date=05/04/1983 - date with format https://serkanyersen.lib.id/date-parse/?date=05-04-1983&fromFormat=DD-MM-YYYY - date with formatted output (checkout formatted section) https://serkanyersen.lib.id/date-parse/?date=05-04-1983&fromFormat=DD-MM-YYYY&toFormat=MMMM%20Do%20YYYY - Epoch date https://serkanyersen.lib.id/date-parse/?date=420854400&fromFormat=epoch - Epoch with milliseconds https://serkanyersen.lib.id/date-parse/?date=4208544003218&fromFormat=epoch-ms
# Date parser This is a simple service that will parse the given date string using moment.js and return a JSON object that looks like this ```json { "formatted": "1983-04-05T00:00:00+00:00", "fromNow": "34 years ago", "toNow": "in 34 years", "timestamp": 418348800000, "daysInMonth": 30, "iso": "1983-04-05T00:00:00.000Z", "object": { "years": 1983, "months": 3, "date": 5, "hours": 0, "minutes": 0, "seconds": 0, "milliseconds": 0 }, "isLeap": false, "isDST": false } ``` ## Params - date: this can be any date string or epoch time you want, you can provide the format for this value - fromFormat: This is where you tell the system what format your date is, you can omit this for standart formats. If you want to use unix time stamps, you need to send `epoch` with this param, if your timestamp contains milliseconds then it needs to be `epoch-ms`. otherwise moment.js will not understand your date - toFormat: this is the format you want your output in. you can check moment.js documentation to see all format fields that you can use. ## Examples - only date provided https://serkanyersen.lib.id/date-parse/?date=05/04/1983 - date with format https://serkanyersen.lib.id/date-parse/?date=05-04-1983&fromFormat=DD-MM-YYYY - date with formatted output (checkout formatted section) https://serkanyersen.lib.id/date-parse/?date=05-04-1983&fromFormat=DD-MM-YYYY&toFormat=MMMM%20Do%20YYYY - Epoch date https://serkanyersen.lib.id/date-parse/?date=420854400&fromFormat=epoch - Epoch with milliseconds https://serkanyersen.lib.id/date-parse/?date=4208544003218&fromFormat=epoch-ms
Parses given dates using moment js
  info
context
enabled
bg
info
pricing
free
rate limits
  parameters (click to modify)
{string}
date
= ""
any date you want
{string}
fromFormat
= ""
OPTIONAL format of the date you provide, will also accept 'epoch' and 'epoch-ms'
{string}
toFormat
= ""
OPTIONAL format that you want to convert to
  code