JavaScript Date & Time FAQ
You are here: irt.org | FAQ | JavaScript | Date & Time
- FAQ 1 How do you check if a date is valid?
- FAQ 2 How can I calculate the number of days elapsed between two dates?
- FAQ 16 How can I compare a date in a string with todays date?
- FAQ 29 How can I calculate someone's age in years, months and days?
- FAQ 34 How can I display today's date on my home page in the following styles...?
- FAQ 50 How do I show a customized message based on the time of day?
- FAQ 58 How can I make the lastModified date more readable?
- FAQ 99 How can you display how many years, months & days are left until 31/12/1999?
- FAQ 147 How do you subtract X hours from a date?
- FAQ 170 How do you add a number of months to a date and then format the output?
- FAQ 217 How can I calculate the difference between two dates?
- FAQ 228 How do you calulate the Julian day number of a date?
- FAQ 238 How can I convert a form field value in HH:MM:SS to pure seconds?
- FAQ 256 How can I show the documents last modified date in the format: month, date, year, time(GMT)?
- FAQ 268 How do I work out the date seven days before a text string mm/dd/yy?
- FAQ 281 How can I tell when Daylight Saving is in effect?
- FAQ 300 How can I make the lastModified date more presentable and include the time as well?
- FAQ 301 Does setYear work correctly if it is given a two-digit year?
- FAQ 344 How can I place the date and time that a form was displayed into a hidden form field?
- FAQ 368 How can you display how many days are left until 31/12/1999?
- FAQ 379 How can I have a popup date selector return dates to different form fields?
- FAQ 451 How can I find the day of the week for a given date?
- FAQ 468 How can I detect the hour of the day, and then when someone selects a link, they go to either a "day" page or a "night" page?
- FAQ 469 How do I get the dates of next seven weeks in advance
- FAQ 470 How can I date/time stamp a form field as the form is submitted?
- FAQ 504 How do I get the time on the server, and not on the client computer?
- FAQ 533 How can I calculate the number of days in the current month?
- FAQ 548 How do I validate a start date and an end date so that start is less than end, and that end is before todays date, using the date format dd/mm/yyyy?
- FAQ 549 How can I convert a text string: "Wed Aug 26 14:40:45 MET DST 1998." into a Date object?
- FAQ 550 Is there a problem with how the MacOS gives up its date/time?
- FAQ 571 How can I store the current date in a hidden form field?
- FAQ 583 How can I count the time in seconds that a checkbox is really checked?
- FAQ 586 How can I show clocks, one showing the current time, and another showing a time 12 hours behind?
- FAQ 605 How can I convert a mm/dd/yy date to dd/mm/yy and vice versa?
- FAQ 613 How can I automatically calculate the date of the next meeting which is held on the second Thursday of each month?
- FAQ 620 How can I warn that a form submission is due after 25 minutes then submit after a further five minutes?
- FAQ 626 How can I add two times together, 08:30 and 08:45 and get 17:15?
- FAQ 656 How can you write to the document both the Last Modified and a review date, i.e. Last Modified date plus 100 days?
- FAQ 658 The lastModified doesn't appear to be Y2K compliant, for example a document amended with a date of 11th of June 2001 will show 01 as the year when using either getDate() or getFullDate(), is there a workaround?
- FAQ 702 I have to run my code which uses the Date object on older browser versions, how do I cope with dates greater than 2000?
- FAQ 724 How can I display the date in the format weekday, dd, month, year, for example Friday, 11 Dec 1998?
- FAQ 785 How do I pass the client's local time to a server side process?
- FAQ 807 How can I subtract 12 months from a date in Julian form and decide whether to subtract 365 days or 366 days (when one of the months included in the 12 months is February and contains 29 days)?
- FAQ 808 How do I convert a date from YYMMDD to YYYYDDD?
- FAQ 814 Is it possible to accept the year, month and activity from a form an then load the relevant index page page from an activity subdirectory within a month subdirectory with a year subdirectory, e.g. 1996/09/running/index.htm?
- FAQ 819 How can I calculate how many hours per each month?
- FAQ 842 How can I validate a date to be in the format dd/mm/yyyy?
- FAQ 851 Can I show clocks indicating time in different parts of the world?
- FAQ 855 How do I produce an alert after a certain predetermined time?
- FAQ 857 How do I validate a date in the format YYMMDD?
- FAQ 914 How can I calculate the week number of the current date?
- FAQ 917 How can I count down from 15 seconds and then display an alert message?
- FAQ 919 How do I convert a date in milliseconds back to a date string?
- FAQ 938 How can I keep two sets of dates, chosen from drop down select boxes a maximum of 17 days apart, if the first date automatically updates the second date to be 17 days past the first date?
- FAQ 1009 How can I have a stop watch that can be paused and unpaused?
- FAQ 1029 How can I schedule a meeting for the second Tuesday in every other month?
- FAQ 1037 Are there any Y2K date issues with JavaScript?
- FAQ 1127 How do I calculate the following dates based on todays date : StartOfLastYear, EndOfLastYear, StartofThisYear, EndOfThisYear, StartOfLastMonth, EndofLastMonth, StartofThisMonth, EndofThisMonth, StartofLastWeek, EndofLastWeek, StartofThisWeek, EndOfThisWeek?
- FAQ 1130 How can I display all Sunday - Thursday dates in a list for the entire current year?
- FAQ 1141 How can I setup a clock with defined alarm times which trigger another event?
- FAQ 1142 How do I add a number of days to a date?
- FAQ 1203 I've seen timers that countdown in weeks, days, hours, minutes and seconds, but how can I show a single figure that counts down once every second?
- FAQ 1204 How can I count down in seconds from the current time to the year 2000?
- FAQ 1309 How can I show all the dates between two dates in YYYY-MM-DD format?
- FAQ 1349 How can I check that a string contains a date?
- FAQ 1430 How can you compare today's date with a date in a string, then respond wether the string date is ahead, the same, or behind today's date?
- FAQ 1436 How can I show the number of days, hours and seconds till Y3K?
- FAQ 1451 How can I generate a new date for the beginning of the week, ie, generate the date for the Monday, if the date given is the Thursday of that week?
- FAQ 1464 How do I convert the number of milliseconds since January 1, 1970, 00:00:00 into its corresponding date (dd/mm/yy format)?
- FAQ 1479 How can I have a clock on a webpage that syncs with the Atomic clock?
- FAQ 1493 How can I make a drop down list of dates where the list will display dates in the format mm/dd/yy from today to 14 days before only (this is for a time sheet entry process where dates more than 2 weeks old cant be input)?
- FAQ 1494 How can I round numbers with the decimal accuracy specify, correctly. When using Math.ceil it rounds always upwards i.e. 123.1234 (3 decimals) rounds to 123.124 although it shoud be 123.123?
- FAQ 1512 How can I countdown to the 17th of May - when I graduate?
- FAQ 1520 How do I display the current date as selected options in year, month and day select options?
- FAQ 1534 How do I use Eastern Standard Time?
- FAQ 1536 How do I create a Javascript that if it is before a specific time (for example, 9 am) it will display tomorrow's day but will show the day AFTER tomorrow day if it is after that specific time?
- FAQ 1568 How can I find the last day of the month for any given month?
- FAQ 1635 Can I prefill a text form field with the current date?
- FAQ 1649 How can I show the next seven days in a drop down list?
- FAQ 1688 How do I find the number of days in a month (or last day of a month)?
- FAQ 1765 How do you check if a date is valid?
- FAQ 1773 Given a start date and a number of days can you calculate the end date?
©2018 Martin Webb