KLocale::formatDate()

Reinhold Kainhofer reinhold at kainhofer.com
Sun Feb 4 20:54:39 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Son Feb 4 2007 schrieb David Faure:
> On Saturday 03 February 2007, Adriaan de Groot wrote:
> > I'm asking in particular because I found some code that does:
> >
> > QString oldFormat = KGlobal::locale()->dateFormat();
> > KGlobal::locale()->setDateFormat(newFormat);
> > QString formattedDate = KGlobal::locale()->formatDate(date);
> > KGlobal::locale()->setDateFormat(oldFormat);
>
> Why doesn't this code create a different KLocale object, set the date
> format on it, and use it to format dates? 

Because I needed a workaround for the "missing" general formatDate( const 
QDate &, const QString &format) method, and this was the first hack that came 
to my mind...

Cheers,
Reinhold
- -- 
- ------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: reinhold at kainhofer.com, http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFFxkgSTqjEwhXvPN0RAjlxAJ42fsUADlCvL2EID4vq866WRJW2FQCfc/i7
YZYWl1lAuKRc4Ou1Dd5KgoY=
=aiTf
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list