date

How can I convert VC++'s DATE Type To C#'s DateTime ?

I got a binary file, and one of record field stored some date infomation. The save program is written by VC++ and using the DATE type. How can read it into C#'s DateTime type ? ...

Date Difference in mysql

hey all, i have a problem regarding date diff function of mysql, i can use it and it is simple but i dont understand that how do i use it to collect difference within the table field. e.g. i have a column "dob" and i want to write a query that will do something like select dateDiff(current_timeStamp,dob) from sometable 'here dob is the...

how can i get the day of a specific date in php?

For example I want to get the day (Sunday, Monday,...) of October 22. How can i do that? ...

Problem in Rails scaffold for DATE fields

When I use Rails scaffold, I can't access the page to edit fields. It shows me some kind of problem with all DATE fields. Here's the error: can't convert Symbol into String Extracted source (around line #124): 121: </p> 122: <p> 123: <%= f.label :dataDeCadastro %><br /> 124: <%= f.date_select :dataDeCadastr...

Accessing date() variables send from the date helper in rails

Hay, not sure if i've missed the point of the helpers in rails, but i used the date() helper and now i don't know how to access the variables returned. Heres the helper code <%=date_select("game", "release_date", :order => [:day, :month, :year])%> How do i access the returned variables in a controller? Thanks ...

extract date from datetime stamp

Anyone know how to extract the date from a datetime stamp as part of the where clause? eg. select * from tableA where date between '01/08/2009' and '31/08/2009' (Date is a timestamp!) Many thanks, Fiona ...

Backing up a folder for the last 7 days with a DOS batch file

I'm trying to make a script that will make a copy of a folder (in Windows) every day for the last 7 days. On the 8th day I want it to take the oldest copy and overwrite it and so on and so forth so at any one time I'll have a 7 day "history" of the folder. Now I've done that previously in Linux simply by telling a daily bash script to c...

Why the date format (actually language) is different in two aspx page

I have 2 aspx pages both gets date data from the same database table (same date field) but one shows the date like 04.09.2009, the other shows 9/4/2009. Both uses same format. <%# Eval("newsDate", "{0:d}") %> Any ideas? I am not familiar with web programming. Cheers, Burak ...

How to compare a date from mysql with current date and send a notification email

I have database entrys that have a date column ( mySQL date type ). I want to compare that date with the current server date and with 3 days before that day, every month, to automatically send an email to a specified address. ...

I want to compare the current date of my server with a date stored in a mySQL database

How can I compare the current date of the web server with a date I have stored in the mySQL database and 3 days before that that in the database to send a notification email ? ...

Query most recent TWO entries per widget

I have two tables. One (Widgets) has a list of widgets (ID, widget_name, color, etc...) and data about them. The other one (Tests) has a list of tests run on the widgets (ID, date, info1, info2, etc...). What I want to do is display the most recent TWO tests. I dont think i really need to use the table Widgets for this but i described ...

how to get TimeZoneInfo short name

Is there any method to get the 3 char code from System.TimeZoneInfo.Local ? e.g. EDT instead of Eastern Daylight time etc. ...

Java Date vs Calendar

Could someone please advise the current "best practice" around Date and Calendar types. When writing new code, is it best to always favour Calendar over Date, or are there circumstances where Date is the more appropriate datatype? ...

Is there a Python function to determine which quarter of the year a date is in?

Sure I could write this myself, but before I go reinventing the wheel is there a function that already does this? ...

SQL Hurdle - SQL Server 2008

The following query returns the total amount of orders, per week, for the past 12 months (for a specific customer): SELECT DATEPART(year, orderDate) AS [year], DATEPART(month, orderDate) AS [month], DATEPART(wk, orderDate) AS [week], COUNT(1) AS orderCount FROM dbo.Orders (NOLOCK) WHERE customerNumber = @custnum AND...

MySQL - Change date string to date type in place?

(Hi all. I'm new-ish to SQL and MySQL in particular. I know some PHP.) I have a table which contains a "date_string" column. For legacy reasons, this is a text field, containing the date in d/m/YY format. e.g. "22/11/09" for 22nd November 2009. Question: how could I convert all fields in this column to a standard MySQL date format (YY...

Can you tell me a good Java Date formatter to parse a Javascript Date object?

Hi, clientside I have some scripts that send to the server some strings... one of which comes from a Javascript Date object. Now, it has it own formatting and I was just wandering if is there a class that does the right conversion, as I am experiencing problems with SimpleDateFormatter... ...

postgres update a date field when a boolean field is set to true

For the sake of the example, consider a table create table foo ( contents text NOT NULL, is_active boolean NOT NULL DEFAULT false, dt_active date ) I insert a record: insert into foo (contents) values ('bar') So far, so good. Later on, I now want to 'activate' the record: update foo set is_active = true What I would like t...

Calculating the difference between two dates

I have tried like this <script type="text/javascript"> var date2=02/09/2009; var date1=03/12/2009; var diff = date1.getDate()-date2.getDate(); alert (diff); </script> but it's not working, is that reason getDate will work only for Date? How to find the difference between these two dates? Am I not able use this ...

C Library for Parsing Date Time

Is one aware of a date parsing function for c. I am looking for something like: time = parse_time("9/10/2009"); printf("%d\n", time->date); time2 = parse_time("Monday September 10th 2009") time2 = parse_time("Monday September 10th 2009 12:30 AM") Thank you ...