I'm converting a date stored in a calendar object in a string for a query in MySQL. I need the string in format "yyyy-MM-dd HH:mm:ss", i.e.: "2010-01-01 15:30:00".
I'm using a code like:
Calendar TimeStop = Calendar.getInstance();
TimeStop.set(2010, 01, 01, 15, 30, 0);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd ...
I am scratching my head over something rather stupid yet apparently difficult.
DataView dvFormula = dsFormula.Tables[0].DefaultView;
dvFormula.RowFilter = "'" + startDate.ToString("yyyyMMdd") + "' < EndDate OR EndDate = '19000101'";
dvFormula.Sort = "FromDate ASC";
The result is this:
Cannot perform '<' operation on System.String ...
More of a warning than a question:
We resolved a very puzzling bug this morning. We have a variety of reports that allow users to enter date ranges they want to run. The assumption is, if you ask for a report from 8/1/2010 to 8/10/2010 you meant to include 8/10/2010 so the end-date of the report isn't 8/10, it's something after that.
I...
Is there any simple way to create a column in MS SQL that will track the last time a record was updated?
I would like to have two fields. One to track when the record was created. That one is simple. Create a datetime field and set its default to getdate(). However the second field seams to be a bit more tricky. I want it to have the la...
Hello
Within my WP site I have a category called 'events' where I am publishing event information using two custom fields:
eventdate = human readable event date
eventsortdate = YYYY/MM/DD to list events in the correct order.
I have this bit of code from a helpful post here: http://www.davidrisley.com/events-list-with-wordpress/
<?p...
I first retrieve information from the SQLite database into a cursor.
The cursor contains a timestamp column in the format: yyyy-MM-dd HH:mm:ss.SSS, for example, 2010-08-27 21:25:30.575
Once retrieved, I set aSimpleCursorAdapter like so (code simplified):
SimpleCursorAdapter adapter =
new SimpleCursorAdapter(this, R.layout...
I'm building an application that checks when a user needs to change the oil of one of his cars. Here's how it works:
The user enters the name of his car (e.g. 'Ford Mustang')
The user enters the time the car will run on one oil change (e.g. 3.months)
The user saves the car to the database
Repeat above process for all his other cars. (Y...
Hi all. I have this question.
I am using php, mysql and my files will be hosted on linux machine.
Is it possible to change the date on a different format. I mean the date should change if it is 5PM. That is if today is 28th august 2010, then after 5pm it should show 29th august 2010.
Thanks a lot.
...
I have a 2d numpy.array, where the first column contains datetime.datetime objects, and the second column integers:
A = array([[2002-03-14 19:57:38, 197],
[2002-03-17 16:31:33, 237],
[2002-03-17 16:47:18, 238],
[2002-03-17 18:29:31, 239],
[2002-03-17 20:10:11, 240],
[2002-03-18 16:18:08, 252],
[...
I need to do a calculation for my crystal report.
In report, there will be Times(in Hour:Min:Sec)like this..
00:12:34
00:52:12
23:19:56
and so on..
I need to add them together so that..results will be
Hr:min:ss
Hr may be more than 100..
but can't change to day
How to achieve that?
Thanks a lot..
...
Hi,
I am faced with an issue in Ruby on Rails. I am looking to convert a string of format Tue, 10 Aug 2010 01:20:19 -0400 (EDT) to a date object.
Is there anyway i could do this.
Here is what I've looked and tried at the following with no luck:
Date.strptime(updated,"%a, %d %m %Y %H:%M:%S %Z")
Chronic Parser
Ruby: convert string to ...
Dear all,
I noticed already a couple of times that working with dates doesn't allow for using the usual tricks in R. Say I have a dataframe Data with Dates (see below), and I want to convert the complete dataframe to a date class. The only solution I could come up with until now is :
for (i in 1:ncol(Data)){
Data[,i] <- as.Date(Dat...
I want to match dates that have the following format:
2010-08-27 02:11:36
i.e. yyyy-mm-dd hh:mm:ss.
Right now I am not very particular about the date being actually feasible, but just that it is in the correct format.
Possible formats that should match are (for this example)
2010
2010-08
2010-08-27
2010-08-27 02
2010-08-27 02:11
20...
Hi,
How do I query a mysql db to return all records with a datetime older than 1 week ago. Note that the datetime table stores everything in UTC, and i should be comparing it in that itself...
Jusst to be clear - I'm looking for a pure mysql query
...
Hi
I have the following simple xml:
<root>
<item>
<d>2002-05-30T09:00:00</d>
</item>
<item>
<d>2005-05-30T09:00:00</d>
</item>
<item>
<d>2003-05-30T09:00:00</d>
</item>
</root>
Now I want to find the minimum or maximum dateTime node using XPath.
My solution at the moment is:
/root/item[not(number(translate(./d, 'TZ:-', ...
Hi folks,
I'm trying to parse a datestamp (that I got from Twitter) but am receiving errors. here's the datestamp:
Fri, 27 Aug 2010 22:00:07 +0000
Here's my code:
DateTime.ParseExact(MyDateValue, "ddd, dd MMM YYYY HH:mm:ss +ffff", new CultureInfo("en-US"))
and here's my error:
System.FormatException was unhandled
Mes...
I've been working a lot with the DateTime class and recently ran into what I thought was a bug when adding months. After a bit of research, it appears that it wasn't a bug, but instead working as intended. According to the documentation found here:
Example #2 Beware when adding or
subtracting months
<?php
$date = new DateTime('...
I'm hosting my site in US and my site lists events based on time and holidays and birthdays based on dates..
I'm using php and mysql
when someone visits my site from india the date that will be shown on the site will be a day lesser..
How can i get the change the date and time based upon the visitor's country?
...
Hi guys, I'm taking a string which represents a time value and am storing it in a database table where the field type is also a time value. The problem is that I try to first format the string to be of a date time format using the code:
date('H:m', strtotime($value));
The issue is that its returning the time but with 8 minutes increme...
hello,
how do i convert the string
30.10.2009 in date?
(dd.mm.yyyy)
thanks :>
...