RE: dateformat

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

 



A little help. Use

str_date = g_strdup_printf("%02d/%02d/%02d", gday, gmonth+1, gyear);

Then str_date will always have the same length.

Jorge Monsalvo
Argentina

-----Mensaje original-----
De: gtk-list-bounces@xxxxxxxxx [mailto:gtk-list-bounces@xxxxxxxxx] En
nombre de David Necas (Yeti)
Enviado el: Miércoles, 09 de Marzo de 2005 11:25
Para: Hariyanto
CC: gtk-list@xxxxxxxxx
Asunto: Re: dateformat


On Wed, Mar 09, 2005 at 09:10:32PM +0700, Hariyanto wrote:
> There is still problem because sometime I don't get date with same 
> lenght string. I get 7/8/2005 or 12/12/2005 or 7/12/2005.

Why don't you simply use

  sscanf(datestring, "%d/%d/%d", &d, &m, &y);

?

> I get this date with this code :

Well, that may be the reason.  You can achieve the same with

  str_date = g_strdup_printf("%d/%d/%d", gday, gmonth+1, gyear);

Yeti


--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
_______________________________________________

gtk-list@xxxxxxxxx http://mail.gnome.org/mailman/listinfo/gtk-list


-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.6.4 - Release Date: 07/03/2005




-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.6.4 - Release Date: 07/03/2005


_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list


[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux