Hello,
In my Django web app, an event's status changes from 'upcoming' to 'completed' at a certain date/time. However, I want to update the database as soon as the event object's date/time has passed. Any ideas how I would code this?
My only idea so far is to have a thread constantly running that that checks to see if the event object'...
I want to convert a Python datetime to a an RFC 2822 datetime. I've tried these methods to no avail:
>>> from email.Utils import formatdate
>>> import datetime
>>> formatdate(datetime.datetime.now())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.6...
Hi guys,
I am looking for the best way to add milliseconds to a Java Date when milliseconds is stored as a 'long'. Java calendar has an add function, but it only takes an 'int' as the amount.
This is one solution I am proposing...
Calendar now = Calendar.getInstance();
Calendar timeout = Calendar.getInstance();
timeout.setTime(toke...
Like other questions asked here, im looking to do a simple conversion of time formats. I've found answers on how to do this in Perl, but not in Python.
I have a string like so:
on Jun 03, 02010 at 10:22PM
and I'd like to convert it to a datetime object like this:
Thu, 03 Jun 2010 22:22:00 -0000
I have sliced up my input like so: ...
I need code that takes in a string and determines the date. I wrote a simple 15line function to return the date assuming it is relative. That was easy. Now i need to take in a string such as "jan 17 09" "1/2/3" (is it MM/DD/YY? or DD/MM/YY, here it means the former). I'll need ambiguous return codes or exceptions. What can i use to parse...
Given a date like "4 May", how do I get the most recent 4th May in the format "4 May, 2010"?
If the day/month combination has not yet occurred this year, it should show the date for last year (e.g. "31 December" should translate to "31 December, 2009").
...
Hi All,
I am having an issues passing a JSON containing DateTime to asp.net code-behind (c#).
If the client browser is in the same timezone as the server I have no issue, but if they are in different timezones my time is getting modified by the offset value of the two timezones.
But all my datetimes need to be the date with a time of ...
Open a watch window
new DateTime(2010,01,01).ToString("h")
Gives:
new DateTime(2010,01,01).ToString("h") threw an exception of type System.FormatException
Yet...
new DateTime(2010,01,01).ToString("h ")
Gives: "12 "
So why does an extra space stop this format exception from happening?
Is this a bug?
...
Consider:
Assert.Equal("11 Aug 2010", date.ToString(???);
Somehow ToString("d MMM yyyy") outputs "11 aug 2010". How can I make it to be Aug instead of aug?
...
I have this loop, its purpose is to loop through a range of dates and perform some logic to automate adding entries into the database. The issue is that the incrementing portion, date.AddDays(1.0) isn't working, and is always the same result, causing an infinite loop. Any insight?
for (DateTime date = DateTime.Now; futureDate.Compare...
I am trying to convert a date/time string in this format
YYYY/MM/DD/HH:MM:SS
to a format that is recognized in PHP
...
I want to offer the current date to the user when a new record is created and I want to allow him to edit the offered date. For example I write a bug tracking system and I have a date_of_detection field. 99% of the time it is good if it is the current date, but for the sake of the 1% the user should be allowed to edit it and set any earl...
Please
i want to Insert data date in "textbox" with PHP to myssql. But i can't do it. And show it with format "dd/mm/yyyy" in table
...
Please I need help on how to convert this string [ Fri Jun 19 10:45:39 EDT 2009
] that is in EDT date format back to Date in SQL (Am using Postgres). I want to be able to have something like this 19-06-2009
Thanks
...
I am trying to enter a date with with year 1900 using java into sql bt i am getting exception as :
'com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '1900-01-01 00:00:00' '
...
Hi.
I have a dateTime variable, and I want to convert it to a decimal value of epoch.
How can this be done?
I tried using:
seconds-from-duration($time, xs:dateTime('1970-01-01T00:00:00'))
but it just returns 0.
Please advice.
Thanks.
...
Hi,
I'm fetching a datetime from MYSQL which looks like:
2010-08-11 11:18:28
I need to convert it into the "floor" or the earliest 15 minute interval and output in milliseconds for another function.
So, this case would be:
2010-08-11 11:15:00 in milliseconds
Whoops! Sorry - need to clarify - I need code that will transform it int...
Hi folks,
Does anyone know of a java library that can pretty print a number in milli seconds in the same way that c# does?
E.g. 123456 ms as a long would be printed as 4d1h3m5s
(might not be accurate , but you see hopefully what I'm getting at!!)
-ace
...
Hello
I would like to produce a list of dates based on a user determined "start date", over a 12 week period.
If a user selects today's date, I need to know each date from today over 12 weeks.
Once I have these dates, I would need to insert them into a DB table.
I'd like to say I've made some in-roads into how to do this, I reckon ...
How would I convert this from js to C#. I've looked but cant find anything useful.
var endDate = new DateTime();
endDate.setDate(startDateTime.getDate() + days);
endDate.setHours(endDateTime.getHours(), endDateTime.getMinutes(), endDateTime.getSeconds());
...