• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 839
  • Last Modified:

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

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.

4 Solutions
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
Alfred A.Commented:
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Alfred A.Commented:

I posted the your suggested link already.  :-)
Kumaraswamy RCommented:
I agree with the 1st poster.  You need to determine the time zone offset on the client.  You can run this 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.
sbornstein2Author Commented:
Thanks all
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now