Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting start and last time of day
Message
From
10/01/2006 17:15:22
 
 
To
10/01/2006 17:07:25
Keith Payne
Technical Marketing Solutions
Florida, United States
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01085371
Message ID:
01085407
Views:
17
>Einar's idea is great, with one suggestion. Instead of subtracting a second from midnight, it is probably safer to subtract one from the underlying Long value.

Ok, thanks, I ended up with those two functions:
    ' Return a date starting on the day
    ' expT1 Date
    Public Shared Function GetDateDayStart(ByVal tdDate As Date) As Date
        Return DateTime.Parse(Format(tdDate, "dd/MM/yyyy 00:00:00"))
    End Function

    ' Return a date ending on the day
    ' expT1 Date
    Public Shared Function GetDateDayEnd(ByVal tdDate As Date) As Date
        Return DateTime.Parse(Format(tdDate, "dd/MM/yyyy 23:59:59"))
    End Function
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform