×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    32

    How to know the current system time format

    Hi All

    Please, can any one tell me how to know the current system time format.

    Thanks alot.

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to know the current system time format

    locale LC_TIME?

  3. #3
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    82

    Re: How to know the current system time format

    Quote Originally Posted by mabdelaal View Post
    Hi All

    Please, can any one tell me how to know the current system time format.
    What you probably want to do is to follow the example "examples/maemo5/datetime" in Qt package:

    http://qt.gitorious.org/+qt-develope...etime/main.cpp

  4. #4
    Registered User
    Join Date
    Jan 2010
    Posts
    32

    Re: How to know the current system time format

    Thank you all,

    But what about 12/24 time format, how can i know if current system time is 12 or 24 hour.

  5. #5
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to know the current system time format

    Quote Originally Posted by mabdelaal View Post
    But what about 12/24 time format, how can i know if current system time is 12 or 24 hour.
    It's saved in GConf key /apps/clock/time-format and this is not system time format.

  6. #6
    Registered User
    Join Date
    Jan 2010
    Posts
    32

    Re: How to know the current system time format

    Hi all,
    Thanks Daniil

    It worked perfectly.
    Thank you again.

  7. #7
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    82

    Re: How to know the current system time format

    Quote Originally Posted by mabdelaal View Post
    Thank you all,

    But what about 12/24 time format, how can i know if current system time is 12 or 24 hour.
    Are you sure you need this information?

    Normal application will just want to display a date in currently selected format (as done in the pointed example). It should never bother about these small issues.

  8. #8
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to know the current system time format

    Quote Originally Posted by vivainio View Post
    Are you sure you need this information?

    Normal application will just want to display a date in currently selected format (as done in the pointed example). It should never bother about these small issues.
    When we speak about Maemo 5, there is system locale time format and another format set in GConf and used by all UI applications. It's very different from normal.

  9. #9
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    82

    Re: How to know the current system time format

    Quote Originally Posted by divanov View Post
    When we speak about Maemo 5, there is system locale time format and another format set in GConf and used by all UI applications. It's very different from normal.
    Qt wraps the GConf mess in calls to QLocale (as shown in the posted example), so the user can do things "normally".

    (You can check the details from qlocale_maemo5.cpp, function maemo5_is24h()).

  10. #10
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to know the current system time format

    Quote Originally Posted by vivainio View Post
    Qt wraps the GConf mess in calls to QLocale (as shown in the posted example), so the user can do things "normally".

    (You can check the details from qlocale_maemo5.cpp, function maemo5_is24h()).
    That means you cannot get real system time format.

Similar Threads

  1. How can i change system Time programmetically
    By ranjeetk in forum Open C/C++
    Replies: 1
    Last Post: 2009-05-21, 12:19
  2. Get system time change notification - can not work on emulator?
    By bjtuchen in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2009-05-18, 10:22
  3. how to save the system time into the database
    By Joyce An in forum Symbian
    Replies: 6
    Last Post: 2009-04-20, 09:09
  4. Replies: 0
    Last Post: 2009-04-02, 07:49
  5. Getting current date and time
    By Deepa msc in forum Mobile Java General
    Replies: 6
    Last Post: 2008-06-25, 10:08

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×