ex)
javascript :
jQuery("[data-utc-date]").each(function(){
var utc_date_string = jQuery(this).data("utc-date");
var localdate = new Date(utc_date_string);
//console.log(utc_date_string);
//console.log(">> "+ localdate.toString());
//console.log(">> "+ date("Y-m-d", localdate.getTime()/1000));
jQuery(this).text(date("Y-m-d", localdate.getTime()/1000));
});
jQuery("[data-utc-date-time]").each(function(){
var utc_date_string = jQuery(this).data("utc-date-time");
var localdate = new Date(utc_date_string);
//console.log(utc_date_string);
//console.log(">> "+ localdate.toString());
//console.log(">> "+ date("Y-m-d", localdate.getTime()/1000));
jQuery(this).text(date("Y-m-d H:i:s", localdate.getTime()/1000));
});
+
http://phpjs.org/functions/date/
'WEB > HTML&SCRIPTS' 카테고리의 다른 글
jQuery UploadFile plugin (0) | 2019.07.15 |
---|---|
js MarkDown helper library (0) | 2019.07.15 |
JQuery - 스마트폰 감지 (0) | 2019.07.15 |
jQuery.ajax xdom cors 응답 문제 시 (0) | 2019.07.15 |
CSS 핵 정리 (IE6, IE7, IE8, IE9), FF, Chrome, Safari (0) | 2011.10.03 |