Solved

ASp.Net/C# - need to check if client date time to EST time

Posted on 2010-11-24
7
822 Views
Last Modified: 2012-05-10
Hello all.

I have in a database a datetime start and end time.  I need to check the client time zone and see if the date time is > then the start date time I have stored and < then the end date time and store that into a boolean flag true or false.

Is there a way I can do this and a good sample?  I have been looking at some but can't find a good solution to handle this.

Thanks
0
Comment
Question by:sbornstein2
7 Comments
 
LVL 10

Accepted Solution

by:
ALaRiva earned 350 total points
ID: 34209328
It'll have to be done in Javascript, not C#. C# is a server-side language.

Javascript is the only solution to this, however, that makes things tricky since someone could simply modify their time to fit whatever restrictions you have.

Can you explain a bit more on what and how you intend to use this, maybe we can offer an alternative method for going about it.

- Anthony
0
 
LVL 21

Assisted Solution

by:Alfred1
Alfred1 earned 50 total points
ID: 34210005
0
 
LVL 29

Assisted Solution

by:Kumaraswamy R
Kumaraswamy R earned 50 total points
ID: 34210639
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 21

Expert Comment

by:Alfred1
ID: 34210650
@rkworlds,

I posted the your suggested link already.  :-)
0
 
LVL 29

Expert Comment

by:Kumaraswamy R
ID: 34210657
0
 
LVL 21

Assisted Solution

by:MogalManic
MogalManic earned 50 total points
ID: 34247615
I agree with the 1st poster.  You need to determine the time zone offset on the client.  You can run this javascript:
http://www.onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/
and save the value in a hidden field.

Then on the server convert the date time to UTC by applying the time zone offset.  Then convert your server side date time(s) to UTC and compare the dates.
0
 

Author Closing Comment

by:sbornstein2
ID: 34292859
Thanks all
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question