Unix Timestamp Converter

He..he.. ternyata ga susah lho buat unix timestamp converter, berikut script untuk membuat unix timestamp converter:

const // Sets UnixStartDate to TDateTime of 01/01/1970
UnixStartDate: TDateTime = 25569.0;
function DateTimeToUnix(ConvDate: TDateTime): Longint;
Result := Round((ConvDate - UnixStartDate) * 86400);
function UnixToDateTime(USec: Longint): TDateTime;
Result := (Usec / 86400) + UnixStartDate;


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s