datetime

Another DateTime.ParseExact question.

I have the following code. using System; using System.Globalization; class testCompile { static void Main(string[] args) { CultureInfo provider = CultureInfo.InvariantCulture; string format = "mm/d/yyyy"; string strInput = "11/5/2010"; string strOutput = DateTime.Pa...

how do i get mysql rows from 24-48 hours ago?

I have a mysql table with a datetime column. I want to fetch rows which are older than 24 hours but younger than 48 hours. Ive gone through the date time function not quite sure how to approach this or what to do in general. ...

PHP MySQL Date diff

I have the field datetime with DATETIME type in MySQL. In PHP script I set date begin and date end like this: 11/12/1999 and 11/12/2001. In my table datetime saved in the next format: 11.11.1888 00:00:00. How can I compare these dates? Thanks. ...

get data from datetime's column

lets say I have a "Datetime" column in DB. It has a data like "2010-10-01 09:12:00". Beside that, i want to make a searching page which have: <select id="month" name="month"> <option value="01">01</option> <option value="02">02</option> ... </select> <input type="text" id="year" name="year"> How do i do to get dat...

Converting string to time

Hi, I have string like this:"0:385" (first number is seconds, next numbers are milliseconds), I want to use in datagridview with sorting like numbers (not like strings) so I am trying to make DateTime from string but I am not sure how exactly do this. I know I should use method Parse (or ParseExact) but when I tried it it says "String wa...

ASP.net c# Parse int as datetime

Given a time: 1286294501433 Which represents milliseconds passed since 1970, how do we convert this to a DateTime data type? EG: transactionTime = "1286294501433"; UInt64 intTransTime = UInt64.Parse(transactionTime); DateTime transactionActualDate = DateTime.Parse(intTransTime.ToString()); Throws: String was not recognized ...

How to convert the date into paticular format using PHP?

Hi Friends, I am having the input box for getting the value in mm-dd-yyyy format.So When I get the date I try to covert it into YYYY-MM-DD format.But It doesnt work. For Example : <? $birthdate="08-13-2000"; $date=date('Y-m-d',strtotime($birthdate)); echo $date; ?>. Output is 1970-01-01. But If I gave 13-08-2000 I got 2000-08-13.I dont w...

How to convert string to local Date Time?

Hello, I am trying to convert a string of this format: MM/dd/yyyy HH:mm The input is from a US database, so, i.e.: 09/20/2010 14:30 I know that my string is always US time but when I display it, I need to translate that into the local time, so that string should be turned into: 09/20/2010 19:30 (for UK for instance) I tried a few...

make a column in sybase default to the current date/time of row insertion

I have a sybase 15 DB and for one of my tables, I want to make a column default to the current date/time of the row insert. Is this possible? In a sybase text, the following is said: ALTER TABLE sales_order MODIFY order_date DEFAULT CURRENT DATE On my DB this dosn't do anything ,as CURRENT DATE is not recognized. ...

SSIS issue when communicating with Oracle (T-SQL vs. PL/SQL?)

I have an SSIS package set up to pull data from an Oracle database into SQL Server. I recently ran into an issue that was preventing this data pull. The following code works fine in Oracle SQL Developer (it returns rows, as it should): SELECT a.MyField , a.MyOtherField, a.FromDate FROM MyTable a WHERE a.FromDate BETWEEN CONCA...

How does one convert a .NET tick to a python datetime?

I have a file with dates and times listed as huge numbers like 634213557000000000. I believe this is a .NET tick. That's the number of 100 nanosecond increments since midnight on January 1, 1 A.D. What's a good way to read that into a python datetime object? ...

Intelligence when segmenting a datetime value

I have a datetime value in my Event model. Not being a big fan of the default aesthetics of Cake's automagical input, I'm going to create my own. My understanding, though only from reading, is that Cake provides some intelligence around concatenating datetime values on save. Specifically, it will detect month, day, year, hour, minute and...

php - adjusting for timezones

Alright so I have this code which makes a list of dates: $dates = array(); for($i = 1; $i < 10; $i++) { $datetime = mktime(12, 0, 0, date('n'), date('j') + $i, date('Y')); if(date('N', $datetime) != 6 && date('N', $datetime) != 7) { ...

what this line do in c#

i want to understand a line in c#, Int32 dayOfWeekIndex = (Int32)DateTime.Now.DayOfWeek + 1; what this return for example if we run it today ? I do not have the option to run this code. ...

PHP: Date format conversting string 2010-09-02T09:46:48.78 to dd/mm/yyyy

Hi, I am pulling a date string from an API. The returned string looks like this: 2010-09-02T09:46:48.78 I want to convert it to 02/09/2010 (dd/mm/yyyy) but date_format($note['createdate'], "d/m/Y") Results in error: Warning: date_format() expects parameter 1 to be DateTime, string given in Can someone steer me in the right dir...

MySQL Get latest record by date from mutiple tables with values from lookup tables

I want to get the latest MainNumber, Serial, BarType and Notes for a given MainNumber, if they exist. Note that BarType is stored in a lookup table and referenced with BarID. Unreason came up with this: SELECT @MainNumber, COALESCE(n.Notes, 'None') FROM numbers LEFT JOIN notes n ON numbers.MainNumber = n.MainNumber LEFT JO...

hot to date indide paramter in xml

Hi Guys, i made this code for inserting data to an system mail that know to work with xml file. the problem is that i try to create some javascript code for getting the current date of day, and then put it inside the filed date, but without success. i know hot create the date in javascript, my problem is in thx xml file, i mean how ca...

Need the more recent between two DATETIME's in SQL

I have two SQL DATETIME's that I need to compare. I need to set the value of a column to be the more recent date between the two. Is there a function for this? ...

How to display the current time continously in a different time zone?

Hi, I would like to display the current time continuously but in a different time zone? The following code will display the current time continuously. Can I update to get the time in a different time zone.? <script type="text/javascript"> function ShowTime() { var dt = new Date(); document.getElementById("<%= T...

A detailed explaination of what is "wrong" with date handling in GWT

I have seen countless forum posts complaining of issues in GWT when handling dates. I am still very unclear as to what is "wrong" with the date handling, what special considerations need to be made, and when/where/why methods like Date.setMinutes(int minutes) should not be used. Does anybody have feedback? ...