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:07:25
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
 
À
10/01/2006 16:27:38
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01085371
Message ID:
01085403
Vues:
13
>>This might work for you:
>>
>>DateTime now = DateTime.Now;
>>
>>DateTime start = now.Date;
>>DateTime end = now.Date;
>>end = end.AddDays(1);
>>end = end.AddSeconds(-1);
>>
>>MessageBox.Show(start.ToString(),"start");
>>MessageBox.Show(end.ToString(),"end");
>>
>
>This is an interesting approach. The one I did was similar to the approach I used in VFP:
>
>
>        ltDate1 = DateTime.Parse(Format(tdDate, "dd/MM/yyyy 00:00:00"))
>        ltDate2 = DateTime.Parse(Format(tdDate, "dd/MM/yyyy 23:59:59"))
>
Michel,

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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform