[Glade-users] Date Conversion Problem



Shivdeep Krishnan wrote:

I am having problems with GDate / dateedit widget.

1. got date from dateedit and stored in a time_t.
2. converted time_t to struct tm using localtime( )
3. passed struct tm value to a function

In passing the struct tm to a function and then converting it to GDate and then I increment the GDate by 1 
using g_date_add_days().Then I convert it back to struct tm using the g_date_to_struct_tm().But when I try 
to print it I get junk value for the year part. Please help me.


The year field in struct tm is the year since 1900, e.g. 2001 is stored as 101.
Is that the problem?

Damon





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