Hi, can someone please tell me the easiest way to convert the following date created using..
dateTime.ToString("yyyyMMddHHmmss", CultureInfo.InvariantCulture)
into a proper DateTime object?
20090530123001
thanks.
NB: I have tried Convert.ToDateTime(...) but got a FormatException.
...
I am creating a C# program which is using a SQL database. I want to link values of dates to the calendar so that I can use them in the C# program. IE: 04/01/2010 = Monday, 05/01/2010 = Tuesday... etc 11/01/2010 = Monday, 12/01/2010 = Tuesday.
This in in the aim of showing a calendar view, that can be viewed in week lots, and move forwar...
//parses some string into that format.
datetime1 = datetime.strptime(somestring, "%Y-%m-%dT%H:%M:%S")
//gets the seconds from the above date.
timestamp1 = time.mktime(datetime1.timetuple())
//adds milliseconds to the above seconds.
timeInMillis = int(timestamp1) * 1000
How do I (at any point in that code) turn the date into UTC forma...
Here's a timely question. The rules in North America* for time change are:
the first Sunday in November, offset changes to Standard (-1 hour)
the second Sunday in March, offset changes to Daylight (your normal offset from GMT)
Consider a function in JavaScript that takes in a Date parameter, and should determine whether the argument ...
Hello,
I am working in a limited environment developing a python script.
My issue is I must be able to accomplish datetime addition and subtractions.
For example I get the following string:
"09/10/20,09:59:47-16"
Which is formatted as year/month/day,hour:minute:second-ms.
How would I go about adding 30 seconds to this number in P...
I have the following date as string "091020". I am using SubSonic as my DAL. When I do
myObject.DateColumn = "091020"
I get the error "Conversion from type String to Type Date is not valid"
I tried playing with the IFormatProvider and CultureInfo but can't seem to get raid of the error.
What am I missing?
...
Does anyone know where I can read the documentation for the solution to this warning. I can search for the warning and I just get a phonebook's worth of pages that have the same problem.
Anyone?
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting...
I wrote a desktop application and was using datetime.datetime.utcnow() for timestamping, however I've recently noticed that some people using the application get wildly different results than I do when we run the program at the same time. Is there any way to get the UTC time locally without using urllib to fetch it from a website?
...
Is there a way in an Excel VBA macro to get the current datetime in UTC format? I can call Now() to get the current time in the local timezone; is there a generic way to then convert this to UTC?
Thanks, Jon
...
Hi,
I want DatePicker to convert the following text pieces to DateTime (shown in international format) so my customers can write a date in DatePickers textbox faster so it is not just DateTime.Parse I will use:
"3" to 2009-10-03
"14" to 2009-10-14
"1403" to 2009-03-14
"140310" to 2010-03-14
"14032010" to 2010-03-14
I have tried diffe...
Is there a better .net way to check if a DateTime has occured 'today' then the code below?
if ( newsStory.WhenAdded.Day == DateTime.Now.Day && newsStory.WhenAdded.Month == DateTime.Now.Month && newsStory.WhenAdded.Year == DateTime.Now.Year )
{ // Story happened today
}
else
{ // Story didn't happen today
}
...
Is it possible to join two tables based on the same date, not factoring in time?
Something like:
...FROM appointments LEFT JOIN sales ON
appointments.date = sales.date...
The only problem is it is a datetime field, so I want to make sure it is only looking at the date and ignoring time
...
Right now all of my times on my reports are in GMT. Anybody know how to convert this into EST?
...
How can I get the number of a day in a week fro example:
2009-10-21 would be 4 assuming that:
Sun - 1
Mon - 2
Tue - 3
Wed - 4
Thu - 5
Fri - 6
Sat - 7
I am using MySql Server 5.0.37
...
A user can post 4 times at most within a day.
The difficulty is how to get the start of a day in database?I'm using MySQL
...
Function
echo date( "m/d/Y h:i a", "10/22/2009 12:32 am" );
Output
12/31/1969 07:00 pm
Why is my output not giving me the correct date, what am I doing wrong?
...
Hello there,
i am trying to check, with plain c, whether the DST is set on a specific date and time. i have tested gmtime and localtime, but these functions only take care of the current system DST.
Thanks for your advice.
thomas
...
Assuming a 32-bit OS/Browser, could a Date object created in JavaScript rollover to 1970 if I set a date beyond 2038?
The Mozilla documentation says a year can be set to 9999, however I don't know if this is consistent across all JavaScript implementations, or if this is an accurate description of what the specification dictates.
I wou...
I was just about to write this myself, but I know this has to exist and I'm just managing to avoid all the Google keywords that would lead me right to it.
I would be looking for something like DDDMMMYYY where D, M, Y are the number of days, months, and years. So 00103000 would indicate a span of three months and one day, or 000000001 wo...
I'm currently passing some date-time info to a web page using url parameters, which are ticks of date times, and then converting the ticks back into date times when I need to at the other end.
Is there a better way to do this, and why.
for example
http://localhost:57765/dinners/updatedinner/38?startDate=633917664000000000
...