Welcome To Snipplr
Everyone's Recent JavaScript Snippets Tagged date
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
This is used to validate a date in a specific format. The code example is to validate whether it is a valid dd/MM/yyyy Date Format.
1
20309
posted 4 years ago by jlustre
Permet de préremplir des champs avec le premier et le dernier jour du mois courant au format jj/mm/aaaa
0
1171
posted 10 years ago by Igeco
Calculates the time in hh:mm:ss between two dates
Usage:
var past = new Date('1/1/2013');
var now = new Date();
var lapsed = past.lapsed(now);
0
800
posted 11 years ago by camdagr8
I don't really know how other people do this kind of thing, but this was my take.
0
935
posted 11 years ago by domramirez
Javascript which converts a Date object into an ISO 8601 formatted string - 'YYYY-MM-DDTHH:mm:ss.sssZ' - with a fallback for when the function 'toISOString' doesn't exist (e.g. IE 8 or less).
Usage:
var now = new Date;
console.log(now.toISOStrin...
0
1549
posted 11 years ago by davidwaterston
Often on a page footer, we want a copyright date range starting with the year the website was launched and ending the current year. Doing this dynamically means no need to update on 1/1 every year. The js snippet below uses the server date to accompl...
0
1010
posted 11 years ago by rumremix
Find the date with or without a year and with double or single digit month or day. Easily extendable to other date delimiters and formats.
0
1044
posted 12 years ago by pumpkinthehead
Esto es por si estamos desarrollando una aplicación en la cual necesitamos manejar la fecha y hora con javascript.
0
761
posted 12 years ago by jrobinsonc
This requires my [date formatting script](http://snipplr.com/view/54806/javascript-date-formatting/).
(date).toISO() converts the Date object to an ISO 8601 string
Date.fromISO() converts an ISO 8601 string to a Date object
0
1016
posted 13 years ago by wizard04
Extend Date object to have isLeapYear() boolean (true for Leap Years)
Taken from https://raw.github.com/vitch/jquery-methods/master/date.js
0
697
posted 13 years ago by tomasdev
Format a date into a string using several string variables.
Usage:
(new Date("6/6/2011")).format("%W, %B %d%o, %Y");
Result:
Monday, June 6th, 2011
0
1048
posted 13 years ago by wizard04
I always find issue when we want to show date in different format i.e other than mysql default format. (YYYY-MM-DD) using jquery plugin this date format can be converted into any specified date format i.e indian,US,Europe from any html element
0
849
posted 13 years ago by pavanrulz
From webworks, book "CMS Design Using Php and jQuery", page 93
0
625
posted 13 years ago by shinokada
Will convert all of the mysql dates on the page to be localized.
0
774
posted 14 years ago by yisreldov
Creates a DATE and TIME object that can be places on a site.
OPEN-SOURCE: Free to download, use, modify and distribute - so long as all Credits/Comments are left INTACT.
If you have any thoughts, comments or ideas for this script (or another script...
1
1041
posted 14 years ago by darksider