open Unix (* Convert Unix timestamp to Date *) let unix_timestamp = 1733127551 (* Unix timestamp as float *) let tm = Unix.gmtime unix_timestamp let () = Printf.printf "Converted Date: %04d-%02d-%02d %02d:%02d:%02d\n" (tm.tm_year + 1900) (tm.tm_mon + 1) tm.tm_mday tm.tm_hour tm.tm_min tm.tm_sec
1733127551
Unix.gmtime
tm
tm_year
tm_mon
tm_mday
tm_hour
tm_min
tm_sec
yyyy-MM-dd HH:mm:ss
Printf.printf
2024-12-02 08:19:11
Unix.time()
Unix.gmtime()
Unix.gmtime(1589530245.0)
Unix.localtime()
Unix.localtime(1589530245.0)
Unix.mktime()
Unix.mktime(tm)
Unix.strftime()
Unix.strftime "%Y-%m-%d" tm
Unix.strptime()
Unix.strptime "%Y-%m-%d" "2020-05-15"
Unix.sleep()
Unix.sleep(5)
Unix.gettimeofday()