Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Timespan questions
Message
 
To
11/10/2006 15:23:45
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 8.0
Miscellaneous
Thread ID:
01161296
Message ID:
01161301
Views:
15
>I have a beginning date and an ending date, and I want to create a timespan between those dates. Easy enough, but sometimes those dates are on different days, and I want to make sure that Daylight Savings time doesn't mess with my timespan. Anybody know how to handle that?

EndingDate.ToUniversalTime() - BeginningDate.ToUniversalTime() should work.

>Also, with my beginning date and ending date, I want to make note of any portion of the span that may be a Saturday. For example, if I have the beginning date be some friday at 10 PM, and the ending date be the next day at 6 AM, I want to figure out the timespan between those dates that was on Saturday. Is there an easy way to do that?

Doubt there's an easy way to do this. If ending date is on a saturday then just figure out time since midnight or if beggining date is before Sat and ending date is after Sat then amount of time on Sat was 24 hours.
Rip Ryness
International Falls, MN
Previous
Reply
Map
View

Click here to load this message in the networking platform