Results 1 to 6 of 6

Thread: convert world time zone to Indian time zone

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Thumbs up convert world time zone to Indian time zone

    Hi friends,

    I am using Asp.Net application. I need to convert world all country time zone to Indian time zone. Is possible in .net application? Please tell me.

    Hope yours reply.
    Failing to plan is Planning to fail

  2. #2
    Fanatic Member
    Join Date
    Jun 2004
    Location
    All useless places
    Posts
    917

    Re: convert world time zone to Indian time zone

    If you are using .Net 3.5 you can use TimeZoneInfo class. It seems this functionality was not there previously. MSDN

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Thumbs up Re: convert world time zone to Indian time zone

    Hi

    Thanks for your reply. I am using Asp.Net 2.0 . Tell me please using web services, Is it possible?

    Hope your's reply.

    Thanks
    Failing to plan is Planning to fail

  4. #4
    Fanatic Member
    Join Date
    Jun 2004
    Location
    All useless places
    Posts
    917

    Re: convert world time zone to Indian time zone

    From whatever I know, apparently not. But if you are publishing a web service why don't you use UTC time to relay and then the consumer can convert it into their local time zone. Even if your application is the only consumer you can still do so.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Thumbs up Re: convert world time zone to Indian time zone

    HI

    Thanks for your reply. I am not asking like that. In currency converter, codeproject.com website give useful coding using web services. For the same i need for this one.

    Without web service any possible ways are for this one. Give some details.

    I am using java script code. But its very hard to differ time. Because this script given half an hour difference to my country times.

    function calckTime(city,offset)
    {
    //alert("enter");
    //alert(city);
    //alert(offset);
    // create Date object for current location
    d = new Date();
    alert(d);

    var clockTime = getClockTime();

    // alert(clockTime);
    // convert to msec
    // add local time zone offset
    // get UTC time in msec
    utc = d.getTime() + (d.getTimezoneOffset() * 60000);
    alert(utc);
    // create new Date object for different city
    // using supplied offset
    nd = new Date(utc + (3600000*offset));
    alert(nd);

    //return "The local time in " + city + " is " + nd.toLocaleString();
    var TimeName=document.getElementById('txtoffset');

    alert(TimeName);

    TimeName.value=nd;

    // var TimeAnotherName=document.getElementById('txtoffsetanothor');
    //
    // TimeAnotherName.value=nd;

    }

    This is my script.

    Hope your's reply.

    Thanks
    Failing to plan is Planning to fail

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: convert world time zone to Indian time zone

    You just take the logic using TimeZoneInfo and instead of putting it in a method on your page, put it in a method in a web service. Your application then calls the web service, the web service simply uses TimeZoneInfo.

Posting Permissions

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



Click Here to Expand Forum to Full Width