Click here to Skip to main content
15,894,460 members
Home / Discussions / C#
   

C#

 
GeneralRe: DateTime.Now Pin
George_George11-Jun-08 22:19
George_George11-Jun-08 22:19 
AnswerRe: DateTime.Now Pin
DaveyM6910-Jun-08 3:32
professionalDaveyM6910-Jun-08 3:32 
GeneralRe: DateTime.Now Pin
Guffa10-Jun-08 4:20
Guffa10-Jun-08 4:20 
GeneralRe: DateTime.Now Pin
DaveyM6910-Jun-08 4:43
professionalDaveyM6910-Jun-08 4:43 
GeneralRe: DateTime.Now Pin
Guffa10-Jun-08 6:03
Guffa10-Jun-08 6:03 
GeneralRe: DateTime.Now Pin
DaveyM6911-Jun-08 0:41
professionalDaveyM6911-Jun-08 0:41 
GeneralRe: DateTime.Now Pin
George_George11-Jun-08 1:33
George_George11-Jun-08 1:33 
GeneralRe: DateTime.Now Pin
DaveyM6911-Jun-08 2:37
professionalDaveyM6911-Jun-08 2:37 
Hi George,

Let me begin by saying I'm no expert in the internal workings of the framework or compiler! There are many people here who have a far more in depth knowledge of these things, and if I'm wrong, I'm sure they will point out my errors Wink | ;)

As far as I know...
1. There is no additional copy as it works on the actual object passed as a parameter. If there is a copy (I'm not sure how to check), then maybe we could/should force it to be passed by reference?

2. DateTime.Now; returns an instance of the DateTime struct.
DateTime nowDateTime = ... obviously also creates an instance of the DateTime struct.
So now we have two DateTime instances. By DateTime nowDateTime = DateTime.Now; we're simply copying the value of the second to the first.
Obviously you control the lifetime of nowDateTime, I don't know the lifetime of DateTime.Now - I'm still learning too!

Dave

GeneralRe: DateTime.Now Pin
George_George11-Jun-08 16:31
George_George11-Jun-08 16:31 
GeneralRe: DateTime.Now Pin
DaveyM6912-Jun-08 0:39
professionalDaveyM6912-Jun-08 0:39 
GeneralRe: DateTime.Now Pin
George_George12-Jun-08 1:29
George_George12-Jun-08 1:29 
GeneralRe: DateTime.Now Pin
Guffa11-Jun-08 2:19
Guffa11-Jun-08 2:19 
GeneralRe: DateTime.Now Pin
George_George11-Jun-08 1:28
George_George11-Jun-08 1:28 
GeneralRe: DateTime.Now Pin
George_George11-Jun-08 1:26
George_George11-Jun-08 1:26 
AnswerRe: DateTime.Now Pin
#realJSOP10-Jun-08 6:29
mve#realJSOP10-Jun-08 6:29 
GeneralRe: DateTime.Now Pin
George_George11-Jun-08 1:40
George_George11-Jun-08 1:40 
Questionasynchronous function callback Pin
George_George9-Jun-08 17:14
George_George9-Jun-08 17:14 
AnswerRe: asynchronous function callback Pin
N a v a n e e t h11-Jun-08 16:22
N a v a n e e t h11-Jun-08 16:22 
GeneralRe: asynchronous function callback Pin
George_George11-Jun-08 16:34
George_George11-Jun-08 16:34 
QuestionWill Using Console.Beep(); Too Much Damage Your Computer? Pin
qszwdxefc9-Jun-08 16:59
qszwdxefc9-Jun-08 16:59 
AnswerRe: Will Using Console.Beep(); Too Much Damage Your Computer? Pin
Christian Graus9-Jun-08 17:16
protectorChristian Graus9-Jun-08 17:16 
JokeRe: Will Using Console.Beep(); Too Much Damage Your Computer? Pin
PIEBALDconsult9-Jun-08 17:26
mvePIEBALDconsult9-Jun-08 17:26 
GeneralRe: Will Using Console.Beep(); Too Much Damage Your Computer? Pin
MarkB7779-Jun-08 17:49
MarkB7779-Jun-08 17:49 
AnswerRe: Will Using Console.Beep(); Too Much Damage Your Computer? Pin
Joe Woodbury9-Jun-08 19:30
professionalJoe Woodbury9-Jun-08 19:30 
AnswerRe: Will Using Console.Beep(); Too Much Damage Your Computer? Pin
Ashfield9-Jun-08 21:24
Ashfield9-Jun-08 21:24 

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.