How to extract the current date

With an Extract command, you can tell ParseHub to extract lots of different kinds of data by selecting various elements on a page.

However, sometimes you'll want to extract universal data that isn't always on a page, such as the time and date. This is how you can do it:

1. Add a new extract command by clicking the plus button, clicking on Advanced... and clicking on the Extract command in the toolbar.

2. In the newly created command, change the extract text box to $date.toString()

3. This will extract the data in the format: Mon Jun 06 2016 08:30:55 GMT-0400 (EDT)

Other Ways to Extract the Date

You can input different things after $date to get different particular information:

$date.getFullYear() will get the year, in 4 digits.

$date.getMonth() will get the month of the year, from 0 to 11.

$date.getDate() will get the day of the month, from 1 to 31.

$date.getDay() will get the day of the week, from 0 to 6.

$date.getHours() will get the hour in your local time, from 0 to 23.

$date.getMinutes() will get the minute, from 0 to 59.

$date.getSeconds() will get the second, from 0 to 59.

$date.getMilliseconds() will get the millisecond from 0 to 999.

$date.getTime() will get a number for the date, as the number of milliseconds since January 1, 1970, 00:00:00 UTC.

You can look at a full list of all date commands here.

Have more questions? Submit request!

0 Comments

Article is closed for comments.