Getting date and time in regional language

  • Hi,

    I am supporting multiple language for my application. I have set chinese
    language in System Preferences->International pane->Formats tab->Region
    popup button.
    Bcoz of this I can see date in local language (i.e. chinese) in menubar. I
    want same date i.e. in chinese language using cocoa api which I will use to
    show in my application. How to get this date in local language?

    Thanks,
    Palav

    --

    There are many things in your life that will catch your eye but only a few
    will catch your heart....pursue those'.
  • On Dec 4, 2007, at 3:22 AM, parag vibhute wrote:

    > Bcoz of this I can see date in local language (i.e. chinese) in
    > menubar. I
    > want same date i.e. in chinese language using cocoa api which I will
    > use to
    > show in my application. How to get this date in local language?

    Use 10.4-behavior NSDateFormatter objects. Check the documentation for
    more details.

    Nick Zitzmann
    <http://www.chronosnet.com/>
  • How will I implement code for 10.3 also?

    On Dec 5, 2007 1:42 AM, Nick Zitzmann <nick...> wrote:

    >
    > On Dec 4, 2007, at 3:22 AM, parag vibhute wrote:
    >
    >> Bcoz of this I can see date in local language (i.e. chinese) in
    >> menubar. I
    >> want same date i.e. in chinese language using cocoa api which I will
    >> use to
    >> show in my application. How to get this date in local language?
    >
    >
    > Use 10.4-behavior NSDateFormatter objects. Check the documentation for
    > more details.
    >
    > Nick Zitzmann
    > <http://www.chronosnet.com/>
    >
    >
    >
    >
    >

    --

    There are many things in your life that will catch your eye but only a few
    will catch your heart....pursue those'.
  • On Dec 5, 2007, at 10:16 PM, parag vibhute wrote:

    > How will I implement code for 10.3 also?

    There's some NSUserDefaults constants you can use to get the date
    formats for old-style formatters. For whatever reason, the medium-size
    formats are off-limits, but everything else is in the NSUserDefaults
    documentation.

    Nick Zitzmann
    <http://www.chronosnet.com/>
  • You'll have to do two different things, based on whether you're
    running on 10.3 or earlier vs. 10.4 or later, in order to get correct
    behavior. If you're running on 10.3 or earlier, don't set the 10.4
    behavior.

    Deborah Goldsmith
    Internationalization, Unicode Liaison
    Apple Inc.
    <goldsmit...>

    On Dec 5, 2007, at 9:16 PM, parag vibhute wrote:

    > How will I implement code for 10.3 also?
    >
    >
    > On Dec 5, 2007 1:42 AM, Nick Zitzmann <nick...> wrote:
    >
    >>
    >> On Dec 4, 2007, at 3:22 AM, parag vibhute wrote:
    >>
    >>> Bcoz of this I can see date in local language (i.e. chinese) in
    >>> menubar. I
    >>> want same date i.e. in chinese language using cocoa api which I will
    >>> use to
    >>> show in my application. How to get this date in local language?
    >>
    >>
    >> Use 10.4-behavior NSDateFormatter objects. Check the documentation
    >> for
    >> more details.
    >>
    >> Nick Zitzmann
    >> <http://www.chronosnet.com/>
    >>
    >>
    >>
    >>
    >>
    >
    >
    > --
    >
    > There are many things in your life that will catch your eye but only
    > a few
    > will catch your heart....pursue those'.
  • Can you please suggest sample of code?
    That will really help me.

    Thanks,
    Palav

    On Dec 7, 2007 3:43 AM, Deborah Goldsmith <goldsmit...> wrote:

    > You'll have to do two different things, based on whether you're
    > running on 10.3 or earlier vs. 10.4 or later, in order to get correct
    > behavior. If you're running on 10.3 or earlier, don't set the 10.4
    > behavior.
    >
    > Deborah Goldsmith
    > Internationalization, Unicode Liaison
    > Apple Inc.
    > <goldsmit...>
    >
    > On Dec 5, 2007, at 9:16 PM, parag vibhute wrote:
    >
    >> How will I implement code for 10.3 also?
    >>
    >>
    >> On Dec 5, 2007 1:42 AM, Nick Zitzmann <nick...> wrote:
    >>
    >>>
    >>> On Dec 4, 2007, at 3:22 AM, parag vibhute wrote:
    >>>
    >>>> Bcoz of this I can see date in local language (i.e. chinese) in
    >>>> menubar. I
    >>>> want same date i.e. in chinese language using cocoa api which I will
    >>>> use to
    >>>> show in my application. How to get this date in local language?
    >>>
    >>>
    >>> Use 10.4-behavior NSDateFormatter objects. Check the documentation
    >>> for
    >>> more details.
    >>>
    >>> Nick Zitzmann
    >>> <http://www.chronosnet.com/>
    >>>
    >>>
    >>>
    >>>
    >>>
    >>
    >>
    >> --
    >>
    >> There are many things in your life that will catch your eye but only
    >> a few
    >> will catch your heart....pursue those'.
    >
    >

    --

    There are many things in your life that will catch your eye but only a few
    will catch your heart....pursue those'.
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today