473,414 Members | 1,928 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

System.DateTime.Now

System.DateTime.Now

it supposedly exists .. but doesnt seem to exist on my machine?

How can i get the current date from the systme?
Jul 21 '05 #1
3 4987
Darren
What error did you get? What is the problem

Tu-Thac

----- Darren Clark wrote: ----

System.DateTime.No

it supposedly exists .. but doesnt seem to exist on my machine

How can i get the current date from the systme

Jul 21 '05 #2
Sorry... my mistake...

I was trying to do ..

DateVal = new DateTime().Now;

But that doesnt work....

but..
DateTime myDate = new DateTime();
myDate = DateTime.Now;

works
"Tu-Thach" <tu*****@antispam.ongtech.com> wrote in message
news:49**********************************@microsof t.com...
Darren,
What error did you get? What is the problem?

Tu-Thach

----- Darren Clark wrote: -----

System.DateTime.Now

it supposedly exists .. but doesnt seem to exist on my machine?

How can i get the current date from the systme?

Jul 21 '05 #3
Darren,

You could condense those lines into 1:

DateTime myDate = DateTime.Now;

That way you are not creating a DateTime object just to discard it in the
next line.

--
Jeffrey Wynn
so********@nospam.net
"Darren Clark" <dj*****@iinet.net.au> wrote in message
news:40**********************@freenews.iinet.net.a u...
Sorry... my mistake...

I was trying to do ..

DateVal = new DateTime().Now;

But that doesnt work....

but..
DateTime myDate = new DateTime();
myDate = DateTime.Now;

works
"Tu-Thach" <tu*****@antispam.ongtech.com> wrote in message
news:49**********************************@microsof t.com...
Darren,
What error did you get? What is the problem?

Tu-Thach

----- Darren Clark wrote: -----

System.DateTime.Now

it supposedly exists .. but doesnt seem to exist on my machine?

How can i get the current date from the systme?


Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Abdolhosein Vakilzadeh Ebrahimi | last post by:
Is there any way to construct a System.DateTime which doesn't check year, month and day to be in correct range== no validation? Thanks A.V.Ebrahimi
14
by: Jon Davis | last post by:
I have put my users through so much crap with this bug it is an absolute shame. I have a product that reads/writes RSS 2.0 documents, among other things. The RSS 2.0 spec mandates an en-US style...
3
by: slylos | last post by:
I've got a section of code in my app that keeps track of how much time an employee has accrued, which equals out to 1.33 days of PTO per month. I'm trying to store the time accrued so far in an...
1
by: Hifni Shahzard | last post by:
Hi, I got a stored procedure, where it returns a value. But if I execute it. It gives an error as "Invalid cast from System.Int32 to System.Byte.". To make clear how do I execute this, below I'm...
0
by: RSH | last post by:
I am having a bit of trouble filling a datatable with a query. I'm getting the error message: System.FormatException: String was not recognized as a valid DateTime. at...
18
by: Atara | last post by:
In my apllication I use the following code: '-- My Code: Public Shared Function strDate2Date(ByVal strDate As String) As System.DateTime Dim isOk As Boolean = False If (strDate Is Nothing)...
3
by: Sugandh Jain | last post by:
Hi, I am using property like this.. private DateTime? _propName; public DateTime? PropName { get { return _propName; }
7
by: groups | last post by:
This is my first foray into writing a generic method and maybe I've bitten off more than I can chew. My intent is to have a generic method that accepts a value name and that value will be...
5
by: Brian | last post by:
Hello all. I have a simple application that I was using to test and understand the System.Timers.Timer and noticed that when I stop the application, on occasion, it throughs the following...
0
by: maolimix | last post by:
Hi to all, I have a trouble with datetime...now I explain.. I must to store to a C# variable the values from a "Datetime column" of Sql Server 2005. I tried 3 methods ...in the first two I never...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.