FAQ Database Discussion Community


what's this date format ? 2006-09-01T07:00:00.000+0000 ? is it ISO_8601 ?

date-format,momentjs,iso8601
I am working on REST calls where I need to send date in "2006-09-01T07:00:00.000+0000" format. User enters date in "YYYY/MM/DD" format and I am using "moment.js" to format the date in ISO 8601 using this format "YYYY-MM-DDTHH:MM:SS.MMMZ" . But it gives me this output "1969-06-20T00:06:00.Jun-07:00". So, how do I get...

Format ruby time instance as 2014-09-19T15:40:24Z

ruby,iso8601
If I have a ruby time instance, how can I format it so that it can be formatted into the following: 2014-09-19T15:40:24Z ...

Converting ISO-8601 Timestamp

javascript,iso8601
Is there a JavaScript library function that converts an IS0-8601 time-formatted String: 2015-01-27T00:00:00.328Z into a String with the following format: 'YYYY.MM.DD HH:MI:SS'? Example: convert("2015-01-27T00:00:00.328Z") === "2015.01.27 00:00:00.328"...

PHP SQL update query with form

php,date,unix,datetime,iso8601
<section id="media" class="four"> <div class="container"> <header> <h2>Media</h2> </header> <?php if (isset($_POST["mediaOpslaan"])) { header("Location: #media"); //SQL update query $sqlInsert = 'UPDATE Media SET Album1=:album1, Album2=:album2, Album3=:album3, WHERE ID=:id'; $preparedStatement = $dbh->prepare($sqlInsert); $preparedStatement->execute(array( 'id' => 1, 'album1' => $_POST["album1"], 'album2' => $_POST["album2"], 'album3' => $_POST["album3"] )); } $sth =...

Format Duration as ISO8601 Period with NSDateIntervalFormatter

objective-c,iso8601,nsformatter
I am trying to convert the duration between two dates to the format "'P'yyyy'Y'M'M'd'DT'H'H'm'M's.S'S'". An example of my expected output is: P0Y0M0DT0H0M0.002S (this is port of an Android project that uses DurationFormatUtils). My test case: NSDateIntervalFormatter *durationFormatter = [NSDateIntervalFormatter durationFormatter]; NSDate *date = [NSDate date]; NSDate *end = [date dateByAddingTimeInterval:25];...