Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting start and last time of day
Message
De
10/01/2006 17:15:22
 
 
À
10/01/2006 17:07:25
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01085371
Message ID:
01085407
Vues:
13
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform