Re: [Vala] pubDate to Datetime
- From: Evan Nemerson <evan coeus-group com>
- To: pavol klacansky com
- Cc: vala-list gnome org
- Subject: Re: [Vala] pubDate to Datetime
- Date: Sat, 05 Feb 2011 12:43:18 -0800
GLib.Time.strptime should do the trick. Something like:
GLib.Time tm = GLib.Time ();
tm.strptime ("Sat, 11 Dec 2010 09:35:00 GMT",
"%a, %d %b %Y %H:%M:%S %Z");
The strptime man page has details on the format string.
You can then use GLib.Time.format to output it in whatever format your
database wants. See the strftime man page for details on the format
string for that function.
-Evan
On Sat, 2011-02-05 at 18:13 +0100, pavol klacansky com wrote:
Hi, I have date in this format "Sat, 11 Dec 2010 09:35:00 GMT";
and I need it to store in DB (SQL)
so is there any function for this, or just regex?
thanks
_______________________________________________
vala-list mailing list
vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]