27.11.2014 Views

Working with date and time, time spans, time zones as well ... - Poco

Working with date and time, time spans, time zones as well ... - Poco

Working with date and time, time spans, time zones as well ... - Poco

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

#include "<strong>Poco</strong>/LocalDateTime.h"<br />

using <strong>Poco</strong>::LocalDateTime;<br />

int main(int argc, char** argv)<br />

{<br />

LocalDateTime now; // the current <strong>date</strong> <strong>and</strong> local <strong>time</strong><br />

int year = now.year();<br />

int month = now.month();<br />

int day = now.day();<br />

int dow = now.dayOfWeek();<br />

int doy = now.dayOfYear();<br />

int hour = now.hour();<br />

int hour12 = now.hourAMPM();<br />

int min = now.minute();<br />

int sec = now.second();<br />

int ms = now.millisecond();<br />

int us = now.microsecond();<br />

int tzd = now.tzd();<br />

double jd = now.julianDay();<br />

<strong>Poco</strong>::Timestamp ts = now.<strong>time</strong>stamp();

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!