Simple Unix time output

Post your FreeBASIC tips and tricks here. Please don’t post your code without including an explanation.
bojan.dosen
Posts: 166
Joined: May 14, 2007 12:20
Location: Zagreb, Croatia

Simple Unix time output

Postby bojan.dosen » May 06, 2012 18:32

Here is simple example how to get Unix time format:

Code: Select all

#Include "vbcompat.bi"

Function unixTime(y As Integer, m As Integer, d As Integer, h As Integer, min As Integer, s As Integer) As Integer
   Return (DateSerial(y, m, d)-25569)*86400 + h*3600 + min*60 + s
End Function

? unixTime(2012, 12, 21, 00, 00, 00)
Sleep

Return to “Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 3 guests