함수 datetime2unixtime()

함수 datetime2unixtime()
함수 datetime2timestamp()

1 Bash[ | ]

echo "2014-07-24 21:16:36" | date +%s
# 1406204196
datetime="2014-07-24 21:16:36"
date +%s --date "$datetime"
# 1406204196
datetime="2014-07-24 21:16:36"
unixtime=`date +%s --date "$datetime"`
echo $unixtime
# 1406204196

2 Excel[ | ]

// A1 = 2013-05-15  5:55:01 AM
=(A1-DATE(1970,1,1))*86400
// 1368597301

3 JavaScript[ | ]

var date = "2014-07-24 21:16:36";
console.log( new Date(date).getTime() );
// 1406204196000

4 PHP[ | ]

$datetime = "2014-07-24 21:16:36";
$unixtime = date('U', strtotime($datetime));
echo $unixtime;
// 1406204196

5 Python[ | ]

import time
dt = "2014-07-24 21:16:36"
ut = time.mktime(time.strptime(dt, "%Y-%m-%d %H:%M:%S"))
print ut
# 1406204196.0

6 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}