Solved

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

Posted on 2010-11-24
7
825 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

749 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