[Vala] Time in vala



I can never find enough documentation about time in vala :( so I'm going
to ask a bunch of questions here... Maybe I'll add a GNOME live page
when I've got the important stuff done... God knows I already want to
update the GTK/Cairo stuff to be more detailed.

Anyway. 

I need to turn a timestamp into a string, but I can't seem to see how to
do this... Something like 

int timestamp = "1234151912"; // whatever...
var time = new Time; 
string date_string = Time.strftime("%s", timestamp); 
// an output like yyyy-mm-dd hh:mm would be nice..

I can never seem to read the time vapi stuff properly :/ 

A little introduction to using the features of time would be really
nice, I've got to do a whole load of calculations e.g. convert a
timestamp to a nearest month, day, hour etc... then build a scale of
various months/days/hours near by... I need to convert things back and
forth between timestamps and do things like add one day and get the
timestamp for that etc...

BR,
 K




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]