date

Converting a date formated as DD/MM/YYYY to seconds spent from 01/01/1970?

Following command converts date formated as MM/DD/YYYY to seconds. date -d "01/21/2014" +%s How can I convert DD/MM/YYYY formated date to seconds? Thanks ...

How to handle the Date column of excel sheet in C# code?

Hi I am reading the Excel sheet in c# using interop services. My excel sheet have the date columns of formate dd/mm/yyyy. while reading , runtime i am getting some different values for each cell as :38840,38808,39873...so n so... what does that mean? please help.How to handle the date columns of the excel sheet in C#. please guide me. ...

How to trim minutes and hours and seconds from Date object?

I need to make map where Dates are keys. 2 date objects are equals if they have the same value of getTime() method. I'm interested only in year, month and day. How can I trim unnecessary hours and minutes to get 'clear' dates? ...

Recurrent yearly date alert in Python

A user can set a day alert for a birthday. (We do not care about the year of birth) He also picks if he wants to be alerted 0, 1, 2, ou 7 days (Delta) before the D day. Users have a timezone setting. I want the server to send the alerts at 8 am on the the D day - deleta +- user timezone Example: 12 jun, with "alert me 3 days before" w...

sql - datetime variable versus string representation of datetime variable

I have a query that takes too long to respond when the search parameter happens to be a varchar datatype with date. However, if i convert varchar to datetime variable, the query runs fine. For ex: This takes too long. select count(id) from names where updateddate > '1/5/2010' This runs fine. declare @dateparam datetime set @...

PHP - error when insert date into MySQL

Hello everyone: I've got a typical problem when trying to insert a date into MySQL. The column defined in MySQL is of type DATE. My PHP version is 5.3.0 Apart from this date-related issue, the rest of my code works just fine. And this is my PHP script to do this: $tablename = BOOKS_TABLE; $insert = mysql_query("INSERT INTO $tabl...

SQL Statement to update the date

I have a string 1993-08-02 00:00:00.0 and I would like to update the date field in a Access Table This is what I have but it is not working. UPDATE [Table] SET `Birthdate` = '1993-08-02 00:00:00.0' WHERE `ID` = 000 ...

How to change date formate in mysql stored procedure insert statemant "22-12-2010" to "2010-12-22"

I send the registration date parameter to mysql database like "22-12-2010". But my sql date date type is in another formate how can i change the date formate like "2010-12-22" also i have to insert this into table. Give code in c#,asp.net code behind either sql query statement! Cheerss!!!!! **Thanks A.Ayy...

Convert facebook date format to javascript date

Hi i'm getting events from facebook with fql and javascript sdk. How can i convert the facebook format date in a javascript date? thanks ...

How to find nearest day of week in php?

Hello! How to find a speciefic nearest day of the week in PHP if initially I have a date string like: 07.05.2010? For example, I want to find the nearest Sunday (or any day of the week). How can I implement this? Thanks ...

Sort ArrayList of custom Objects by property

Hello World!! :D I had a question which is pretty easy if you know the answer I guess. I read about sorting ArrayLists using a Comparator but somehow in all of the examples people used compareTo which according to some research is a method working on Strings... I wanted to sort an ArrayList of custom objects by one of their properties:...

Scaffolding A model with an attribute of type datetime creates a 10 years range in the form

For a simple rails application ( 1.86 /2.3.5) , lets say I run a simple scaffold script/generate scaffold blog title:string content:text published:date When I open up the new / edit view for the blog controller in index/new.html.erb , I see that the drop down enabler for date select has a date range of 2005 - 2015 , i.e 5 years +/- ...

Java Date sorting method?

Hi, I have an String array of dates in the format ex:'2010-05-04 11:26:46 +0530'. How can I check whether a particular date in the array is > today? thanks ...

How to format a dateline using php?

I'm wondering how to make the datelines looks like the same. e.g 2007-7, 200707 => 2007-07 Thanks! ...

How to determine that there is date in the string or not with different date format ?

I have a need of checking whether there is the date in the string or not. FUTIDX 26FEB2009 NIFTY 0 -- There is date in the string. FUTIDX MINIFTY 30 Jul 2009 -- There is date in the string. FUTSTK ONGC 27 Mar 2008 -- There is date in the string. How can I do that ? ...

mySQL query : working with INTERVAL and CURDATE

Hello, i'm building a chart and i want to recieve data for each months Here's my first request which is working : SELECT s.GSP_nom AS nom, timestamp, AVG( v.vote + v.prix ) /2 AS avg FROM votes_serveur AS v INNER JOIN serveur AS s ON v.idServ = s.idServ WHERE s.valide =1 AND v.date > CURDATE() -30 GROUP BY s.GSP_nom ORDER BY avg DE...

Regex for date.

What should be the regex for matching date of any format like 26FEB2009 30 Jul 2009 27 Mar 2008 29/05/2008 27 Aug 2009 What should be the regular expression for that ? I have regex that matches with 26-Feb-2009 and 26 FEB 2009 with but not with 26FEB2009. So if any one know then please update it. (?:^|[^\d\w:])(?'day'\d{1,2}...

How can I define the search scope by "this week" meaning Monday - Friday in Ruby on Rails?

This is an extension of an earlier question. I realized, what I really want is to go to a URL /report/thisweek and it will do a .find (or named_scope) across contact_emails.date_sent where date_sent is between MONDAY and FRIDAY of the week to which Date.today belongs. In other words, if today is THURSDAY, it will do a search for all em...

C# calcuate date ranges from a list of dates.

Hi Given a list of dates (which may not be sorted), I want to build a list of date ranges - E.g. Assuming MM/DD format, Input - 5/1, 5/5, 5/6, 5/15, 5/7, 5/8, 5/19,5/20, 5/23 Output - Date Range 1: 5/1 to 5/1 Date Range 2: 5/5 to 5/8 Date Range 3: 5/15 to 5/15 Date Range 4: 5/19 to 5/20 Date Range 5: 5/23 to 5/23 Basically, a...

Removing rows from MySQL table where the timestamp is over one day old?

I found the exact same question here. But it isn't working for me. I've modified it a bit, manipulated it, and I can't figure it out. I'm trying to remove rows that are over a day old. Here is my code: if (isset($_POST['prune'])) { $sql = "DELETE FROM logs WHERE time < date('now', '-1 days')"; mysql_query($sql); echo 'Log...