I have a table that has a datetime column and I need to retrieve records with a date within the previous hour, day, week, month etc.
One constraint is that I need to support Oracle, MySQL, DB2 and SQL SERVER. Can I achieve this with one SQL query only?
...
I'm working on a Rails application that allows users to define Tasks, which require a due_date. The due_date may or may not include a time.
The way we're handling this right now feels like a hack. due_dates default to 12:00 AM, and in that case we don't display a time. The DateTime object doesn't allow for empty Time values as far as I ...
Hello,
I've been using Chronic, the natural language parser and its awesome. The problem I'm running into now is I cant parse the military time its give me back in to some form of AM/PM time that would be normal for a user to see.
<%= Chronic.parse("next monday") %>
yields => Mon Jul 05 12:00:00 -0500 2010
Is there a way to go b...
I'm facing an interesting problem:
I have several date ranges that can overlap
each of them has a name
Is it possible to "des-overlap" theses ranges? That is, to generate:
a new set of ranges where none overlaps the others
each of this new range has a list of corresponding names
Maybe I can make this a bit more graphical. This i...
I need to be able to get the last day of the previous month into a date variable. The script could be run on any day of the current month. It needs to dynamically adjust even if the last day of the previous month falls on 29,30, 31 etc.
What would be the best day to do this?
...
I have a database table containing credit card records. One of the fields is a Date field. I would like to update this field by changing the year portion of the date to 2011 if the year is less than 2010. From what i have found, PLSQL has functions for time and months but nothing to do with years (to my knowledge).
...
Hi,
after hours of research I still haven't found any answer.
I'm trying to send a DateTime as a Parameter to a Method exposed over a WCF RESTful Service with JSON encoding.
The request looks like this:
POST http://IP:PORT/LogService/json/GetLogEntriesByModule HTTP/1.1
Content-Length: 100
Content-Type: application/json
Host: IP:PORT
Co...
I'm using Access 2003. Have a table with some date values in a text data column like this;
May-97
Jun-99
Jun-00
Sep-02
Jan-04
I need to convert them to proper date format and into another Date/time column, So create a new Date/Time columns and just updated the values from the Text column into this new column. At first it looked fine,...
Hey there, I am extracting the date and time of creation of a file. the date should be 7/1/2010 2:08 PM but the format comes out as 2:08:07 01/07/2010 when called from my application. I would like it show as it does in the file explorer (7/1/2010 2:08 PM). How can I accomplish this?
string createdOnCMM = Creationtime; //this returns...
How do I split a date that is of the form YYYYMMDD into its constituents?
my ($yyyy, $mm, $dd) = $date =~ /(\4d+)(\2d+)(\2d+)/;
...
Basically, I want my script to pause between 4 and 5 AM. The only way to do this I've come up with so far is this:
seconds_into_day = time.time() % (60*60*24)
if 60*60*4 < seconds_into_day < 60*60*5:
sleep(time_left_till_5am)
Any "proper" way to do this? Aka some built-in function/lib for calculating time; rather than just using s...
What is the best way to calculate the total number of seconds between two dates? So far, I've tried something along the lines of:
$delta = $date->diff(new DateTime('now'));
$seconds = $delta->days * 60 * 60 * 24;
However, the days property of the DateInterval object seems to be broken in the current PHP5.3 build (at least on Windo...
Hi all,
Is there any way to write a Regex that can validate one type of delimiter in one date time string only?
For example, 30/04/2010 is correct but 30-04/2010 is incorrect.
I googled and found something about backtrack but I am not very sure how to use it. For example, if i have this regex:
(?P<date>((31(?![\.\-\/\—\ \,\–\-]{1...
i have a collection of objects and i am looking to sort by a property that is a DateTime?
list.OrderBy(r => r.Milestone)
where milestone is a:
public DateTime? Milestone { get; set; }
it seems to put all of the items with novalue at the top of the sort. Is there anyway to sort by date but put the empty items at the bottom of t...
Hi
I have a data table which is updated every day except Saturday and Sunday.
The problem lies in so that when I retrieve data with max (date) and max (date) -1
But it fails when I try to retrieve data for today (Monday) and yesterday (Sunday) when max (date) -1 does not exist.
the data can be updated on Saturday and Sunday, but since...
Basically this script will subtract StartTime from EndTime, using a jQuery plugin the html form is populated with Start and End Time in the format HH:MM, an input field is populated with the result, it works except for one issue:
If Start Time is between 08:00 and 09:59 it just returns strange results - results are 10 hours off to be pr...
Hi, I have web service in PHP which gets dateTime object (from asp) . I want to parse this date in my custom format . The date originally is in format "2010-07-05T00:00:00+02:00" . When I'm trying this:
$oDate = strtotime($date_from_webservice);
$sDate = date("d.m.Y",$oDate);
echo $sDate;
I'm getting date "07.04.2010" which is one da...
Hi all,
I'm starting a project to update our XML schema for the SOAP interface for the company I work for. Looking at the XML schemas at w3c I've noticed there's a specific datatype for duration. We currently use "HH:MM:SS" to specify duration, as opposed to 'P5Y2M10D'
The Snr Developer above me has said he'd like to keep everything co...
I am trying to create an application where I want a data grid view to display the data depending on the date that the user selects in the combo box i.e.cmbDate according to my application. The cmbDate displays the available dates in the database. Below is my source code that I have written but on debugging the compiler gives an error of ...
I used the following c# syntax to get month name from month no but i get August i want only Aug..
System.Globalization.DateTimeFormatInfo mfi = new
System.Globalization.DateTimeFormatInfo();
string strMonthName = mfi.GetMonthName(8).ToString();
Any suggestion...
...