Solved

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

Posted on 2010-11-24
7
819 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
Comment Utility
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
Comment Utility
0
 
LVL 29

Assisted Solution

by:Kumaraswamy R
Kumaraswamy R earned 50 total points
Comment Utility
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 21

Expert Comment

by:Alfred1
Comment Utility
@rkworlds,

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

Expert Comment

by:Kumaraswamy R
Comment Utility
0
 
LVL 21

Assisted Solution

by:MogalManic
MogalManic earned 50 total points
Comment Utility
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
Comment Utility
Thanks all
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now