马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
 - (defun XD::Time:GMT2Julian (str / hms hour minus sec year day mouth)
- (and (setq hms (xdrx_string_regexps "[0-9]+:[0-9]+:[0-9]+" str))
- (setq hms (xdrx_string_split (car hms) ":"))
- (setq hour (atoi (nth 0 hms))
- hour (+ (XD::Time:TimeZone) hour)
- minus (atoi (nth 1 hms))
- sec (atoi (nth 2 hms))
- )
- (setq year (car (xdrx_string_regexps "[0-9]{4}" str)))
- (setq year (atoi year))
- (setq day (car (xdrx_string_regexps "(?<=\\s)[0-9]{2}(?=\\s)" str)))
- (setq day (atoi day))
- (setq mouth (car (xdrx_string_regexps
- "Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec"
- str
- )
- )
- mouth (cdr (assoc mouth
- '(("Jan" . 1)
- ("Feb" . 2)
- ("Mar" . 3)
- ("Apr" . 4)
- ("May" . 5)
- ("Jun" . 6)
- ("Jul" . 7)
- ("Aug" . 8)
- ("Sep" . 9)
- ("Oct" . 10)
- ("Nov" . 11)
- ("Dec" . 12)
- )
- )
- )
- )
- (setq str (xd::time:date2Julian year mouth day hour minus sec))
- )
- str
- )
命令: (rtos (XD::Time:GMT2Julian (xd::internet:geturlheader "http://baidu.com"
"date")) 2 15)
"2458195.003773148"
|