Last active
March 10, 2017 05:56
-
-
Save nguyenphucbao68/ff690d23983202b7390c7ef7931c45af to your computer and use it in GitHub Desktop.
Format Time của Api Facebook thành giây
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; #FUNCTION# ==================================================================================================================== | |
; Name ..........: _FOrmatTime | |
; Description ...: Format Time của Api Facebook thành giây | |
; Syntax ........: _FOrmatTime($string) | |
; Parameters ....: $string - String Time. | |
; Return values .: Success : Trả về giây | |
; Failure : @error set về 0 | |
; Author ........: Trojan Nguyen | |
; =============================================================================================================================== | |
Func _FormatTime($string) | |
IF $string="" then SetError(1,0,0) | |
Local $time | |
$string = StringReplace($string, "T", " ") ; | |
$string = StringReplace($string, "+0000", "") ; XÓA BỎ CÁC KÝ TỰ KHÔNG CẦN THIẾT (múi giờ,...) | |
$string = StringReplace($string, "-", "/") ; | |
$time = _DateDiff('s', "1970/01/01 00:00:00", $string) | |
Return $time | |
EndFunc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment