Results 1 to 3 of 3

Thread: QLocale, dateFormat, short and long, Get all format strings?

  1. #1
    Join Date
    Jul 2015
    Posts
    87
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default QLocale, dateFormat, short and long, Get all format strings?

    Hi,

    e.g. when i use QLocale and dateFormat i can get either the long or short format.
    But in Windows (settings for language) are more than one short format for date:

    dateFormat(QLocale::ShortFormat) returns only the current system setting.
    e.g. M/T/JJJJ

    but there are more like this:
    M/T/JJ
    MM/TT/JJ
    and 4 other formats

    How can i get all possible short format strings from system?

    Greetings

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: QLocale, dateFormat, short and long, Get all format strings?

    There is no Qt API, you will write down all the valid combinations yourself.
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  3. #3
    Join Date
    Jul 2015
    Posts
    87
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QLocale, dateFormat, short and long, Get all format strings?

    Thx, some minutes ago i found this:
    https://msdn.microsoft.com/de-de/lib...v=vs.110).aspx
    DateTimeFormatInfo::GetAllDateTimePatterns-Methode) from .NET

    and here with example:
    https://msdn.microsoft.com/de-de/lib...v=vs.110).aspx

    I will try to use that, hope it helps.

Similar Threads

  1. Replies: 34
    Last Post: 22nd March 2016, 17:34
  2. getting a string value back from long converted format
    By prachi kamble in forum General Programming
    Replies: 0
    Last Post: 1st February 2016, 07:05
  3. Replies: 2
    Last Post: 7th November 2015, 09:49
  4. Change QLocale
    By taikongbuhx in forum Newbie
    Replies: 2
    Last Post: 18th October 2013, 01:50
  5. Replies: 2
    Last Post: 3rd June 2011, 07:39

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.