Click here to Skip to main content
15,887,027 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Date format problem Pin
Rajesh Anuhya14-Apr-08 2:06
professionalRajesh Anuhya14-Apr-08 2:06 
GeneralRe: Date format problem Pin
Luc Pattyn14-Apr-08 2:08
sitebuilderLuc Pattyn14-Apr-08 2:08 
GeneralRe: Date format problem Pin
Rajesh Anuhya14-Apr-08 2:19
professionalRajesh Anuhya14-Apr-08 2:19 
GeneralRe: Date format problem Pin
Guffa14-Apr-08 3:08
Guffa14-Apr-08 3:08 
GeneralRe: Date format problem Pin
AHeavey14-Apr-08 3:36
AHeavey14-Apr-08 3:36 
GeneralRe: Date format problem Pin
helelark12314-Apr-08 4:01
helelark12314-Apr-08 4:01 
GeneralRe: Date format problem Pin
AHeavey14-Apr-08 5:05
AHeavey14-Apr-08 5:05 
GeneralRe: Date format problem Pin
Luc Pattyn14-Apr-08 5:17
sitebuilderLuc Pattyn14-Apr-08 5:17 
Hi,

this is not OK, you should call DateTime.Now only once, store it in a variable,
and use it over and over; the way you do it, you may get inconsistent information
(imagine what happens when the time goes from 01:59:59 to 02:00:00 WHILE executing
your very long statement!).

Furthermore, you could do it with the DateTime.ToString() method itself, as Guffa already
told you. That one even accepts some unrecognized characters in its format specifier,
so you could try DateTime.Now.ToString("yyyMMdd_HHmmssfff")

Note that I have put the year first, so alphabetical and chronological order is the same thing.


Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.


GeneralRe: Date format problem Pin
Luc Pattyn14-Apr-08 5:23
sitebuilderLuc Pattyn14-Apr-08 5:23 
GeneralRe: Date format problem Pin
AHeavey14-Apr-08 6:46
AHeavey14-Apr-08 6:46 
Generalconnection error Pin
Member 426231713-Apr-08 22:36
Member 426231713-Apr-08 22:36 
GeneralRe: connection error Pin
N a v a n e e t h13-Apr-08 23:00
N a v a n e e t h13-Apr-08 23:00 
GeneralRe: connection error Pin
Christian Graus13-Apr-08 23:41
protectorChristian Graus13-Apr-08 23:41 
GeneralRe: connection error Pin
Anoop Brijmohun13-Apr-08 23:42
Anoop Brijmohun13-Apr-08 23:42 
GeneralRe: connection error Pin
Christian Graus13-Apr-08 23:55
protectorChristian Graus13-Apr-08 23:55 
GeneralRe: connection error Pin
ChandraRam14-Apr-08 1:11
ChandraRam14-Apr-08 1:11 
GeneralRe: connection error Pin
Member 426231714-Apr-08 2:08
Member 426231714-Apr-08 2:08 
GeneralRe: connection error Pin
Smithers-Jones14-Apr-08 2:42
Smithers-Jones14-Apr-08 2:42 
GeneralRe: connection error Pin
Christian Graus14-Apr-08 3:05
protectorChristian Graus14-Apr-08 3:05 
GeneralRe: connection error Pin
ChandraRam14-Apr-08 4:40
ChandraRam14-Apr-08 4:40 
QuestionHow to send Multiple values for one formula field in crystal reports through vb.net? Pin
aswath00713-Apr-08 22:00
aswath00713-Apr-08 22:00 
GeneralRe: How to send Multiple values for one formula field in crystal reports through vb.net? Pin
aswath00714-Apr-08 2:26
aswath00714-Apr-08 2:26 
Generalmp3 recording / LAME encoder Pin
Fred Worms13-Apr-08 21:26
Fred Worms13-Apr-08 21:26 
GeneralRe: mp3 recording / LAME encoder Pin
Christian Graus13-Apr-08 21:37
protectorChristian Graus13-Apr-08 21:37 
GeneralRe: mp3 recording / LAME encoder Pin
Fred Worms15-Apr-08 7:59
Fred Worms15-Apr-08 7:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.