Displaying the date of the customer, in accordance with its Time zone

Discussion in 'ASP .Net' started by Alexander Vasilevsky, Dec 3, 2007.

  1. Need to display the date of the customer, in accordance with its Time zone

    http://www.alvas.net - Audio tools for C# and VB.Net developers + Christmas
    gift
     
    Alexander Vasilevsky, Dec 3, 2007
    #1
    1. Advertising

  2. Alexander Vasilevsky

    Duy Lam Guest

    Re: Displaying the date of the customer, in accordance with its Timezone

    Alexander Vasilevsky wrote:
    > Need to display the date of the customer, in accordance with its Time zone
    >
    > http://www.alvas.net - Audio tools for C# and VB.Net developers + Christmas
    > gift
    >
    >


    Maybe this code helpful:

    string dateString = DateTime.Now.ToString(
    System.Threading.Thread.CurrentThread.CurrentUICulture.DateTimeFormat.LongDatePattern
    );

    --
    Duy Lam Phuong
     
    Duy Lam, Dec 3, 2007
    #2
    1. Advertising

  3. OK

    http://www.alvas.net - Audio tools for C# and VB.Net developers + Christmas
    gift


    "Duy Lam" <> wrote in message
    news:...
    > Alexander Vasilevsky wrote:
    >> Need to display the date of the customer, in accordance with its Time
    >> zone
    >>
    >> http://www.alvas.net - Audio tools for C# and VB.Net developers +
    >> Christmas gift
    >>
    >>

    >
    > Maybe this code helpful:
    >
    > string dateString = DateTime.Now.ToString(
    > System.Threading.Thread.CurrentThread.CurrentUICulture.DateTimeFormat.LongDatePattern
    > );
    >
    > --
    > Duy Lam Phuong
     
    Alexander Vasilevsky, Dec 3, 2007
    #3
  4. You code runs on server. It has no knowledge about the client machine
    timezone. You need to get in on client side with a javascript call

    Date.getTimezoneOffset()";

    the pass the value to server side in a hidden input control.

    --
    Eliyahu Goldin,
    Software Developer
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin
    http://usableasp.net


    "Duy Lam" <> wrote in message
    news:...
    > Alexander Vasilevsky wrote:
    >> Need to display the date of the customer, in accordance with its Time
    >> zone
    >>
    >> http://www.alvas.net - Audio tools for C# and VB.Net developers +
    >> Christmas gift
    >>
    >>

    >
    > Maybe this code helpful:
    >
    > string dateString = DateTime.Now.ToString(
    > System.Threading.Thread.CurrentThread.CurrentUICulture.DateTimeFormat.LongDatePattern
    > );
    >
    > --
    > Duy Lam Phuong
     
    Eliyahu Goldin, Dec 3, 2007
    #4
  5. "Duy Lam" <> wrote in message
    news:...

    > string dateString = DateTime.Now.ToString(
    > System.Threading.Thread.CurrentThread.CurrentUICulture.DateTimeFormat.LongDatePattern);


    Only if the client and server happen to be in the same time zone...


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
     
    Mark Rae [MVP], Dec 3, 2007
    #5
  6. Alexander Vasilevsky

    Duy Lam Guest

    Re: Displaying the date of the customer, in accordance with its Timezone

    Mark Rae [MVP] wrote:
    > "Duy Lam" <> wrote in message
    > news:...
    >
    >> string dateString = DateTime.Now.ToString(
    >> System.Threading.Thread.CurrentThread.CurrentUICulture.DateTimeFormat.LongDatePattern);
    >>

    >
    > Only if the client and server happen to be in the same time zone...
    >
    >


    If Alexander want display date in browser, it certainly should use
    javascript to do.
    I'm sorry because i only think this require run on one machine although
    this group is aspnet :)

    --
    Duy Lam Phuong
     
    Duy Lam, Dec 11, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VmluY2UgVmFyYWxsbw==?=

    prevent a postback when moving web parts from zone to zone.

    =?Utf-8?B?VmluY2UgVmFyYWxsbw==?=, Feb 8, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    590
    =?Utf-8?B?VmluY2UgVmFyYWxsbw==?=
    Feb 8, 2006
  2. davout
    Replies:
    3
    Views:
    566
    Roedy Green
    Oct 16, 2003
  3. Lighter
    Replies:
    7
    Views:
    682
    Default User
    Aug 25, 2006
  4. Replies:
    8
    Views:
    787
    Boris
    May 1, 2007
  5. thunk
    Replies:
    1
    Views:
    323
    thunk
    Mar 30, 2010
Loading...

Share This Page