datetime

parsing month year pairs into datetime

Hi, Let's say i have 2 strings 'Jan-2010' and 'Mar-2010' and i want to parse it such that it returns 2 datetime objects: 1-Jan-2010 and 31-Mar-2010 (i.e. the last day). What would be the best strategy in python? Should i just split the string into tokens or use regular expressions and then use the calendar functions to get say the la...

How can I parse a strftime formatted string in Perl?

Hi, I am new to Perl and I wan to know whether there is an inverse function to the strftime(). Look, use POSIX qw(strftime); print strftime("%YT%mT%d TTTT%H:%M:%S", localtime) I get: 2009T08T14 TTTT00:37:02. How can I do the oposite operation? From "2009T08T14 TTTT00:37:02" string to get 2009-08-14 00:37:02, knowing the formatting str...

SQL, OPENXML and DateTime conversations...

Hi, I've inherited a mass of stored procedures that take as their only parameter a block of XML, the author then cracks it (using OPENXML) and then updates the a row. I've come across a problem while updating a table that has datetime columns, the following is a snippet of data that currently fails: declare @stuff nvarchar (max); set...

Why would a TableAdapter populate a DataSet with "1/1/2000" for an entire timestamp column?

I have a TableAdapter filling a DataSet, and for some reason every select query populates my timestamp column with the value 1/1/2000 for every selected row. I first verified that original values are intact on the DB side; for the most part, they are, although it seems a few rows lost their original timestamp because of update queries ...

UNIX Timestamp to MySQL DATETIME

Hi all, I have a table with statistics and a field named time with Unix Timestamps. There are about 200 rows in the table, but I would like to change the Unix timestamps to MySQL DATETIME. Without losing the current rows. What would be the best way to update the Unix Timestamp to MySQL's DATETIME? The current table: CREATE TABLE `s...

Parsing non-standard date string from StackOverflow into a .NET DateTime

I'm writing a screen-scraper for StackOverflow. The bit I'm writing now takes the HTML and puts all the information into a model object. I've run into a bit of bother while parsing the information from an answer. The problem is the date format that StackOverflow uses to describe absolute times. DateTime.Parse doesn't work on them. I've...

how to reset the time of datetimepicker in C#

I want to reset the time of a date time picker to 00:00 manually. When i select the date from it i get the time of the instance i select the time is there any way i can reset it to given time? ...

Inserting DateTime into Sql Server 2005

Hello I have a problem inserting a datetime format variable to Sql Server 2005 database. DateTime Format is dd.MM.yyyy conn.Open(); string conString = "SET DATEFORMAT DMY INSERT INTO AmortPlanT (InvestmentID,StartDate,Maturity,IRate,CoupPerYear,parValue) Values (@IIndex,'@StartDate','@Maturity',@IRate,@CouponPerYear,@p...

easter_date() in JavaScript

Hi all! I'm making a calendar generator in JavaScript. I need the Unix Timestamp for easter day midnight, for a given year. Can anyone tell me how I need to do that (in JavaScript)? Thanks in advance. PHP's function can be found here: http://www.php.net/easter%5Fdate ...

Converting input time 00 00 AM to DATETIME for MySQL

How can convert my time received from my $_GET variables as two digit values from a menu example: $hours = 04; $minutes = 45; $ampm = 'PM'; into the correct format to insert into a DATETIME field in MySql ...

Date and time handling in applications serving clients in multiple time-zones?

The internationalization problems associated with string handling can pretty much be solved by following the advice: use Unicode and store everything as UTF-8 in your database, then you'll be able to serve clients using all the world's languages. But what about the internationalization problems associated with date/time handling? Quest...

adding 1 day to a DATETIME format value

In certain situations I want to add 1 day to the value of my DATETIME formatted variable: $start_date = date('Y-m-d H:i:s', strtotime("{$_GET['start_hours']}:{$_GET['start_minutes']} {$_GET['start_ampm']}")); What is the best way to do this? ...

extracting hour value from a DATETIME format

How would I get the hours from a DATETIME format variable. Example: 2009-08-17 13:00:00 And I just need to get '13' ...

Java 7 Date/Time API

I notice that a snapshot of the Java 7 API has been up on java.sun.com for some time, but I only just had a look through it just now, looking specifically for the promised JodaTime-inspired Date/Time API. Alas, I can find no mention of it in the published docs. Is this because it simply hasn't been done yet, and this published API is an...

'datetime.time' has no 'mktime'

I'm trying to convert a datetime object to a UNIX timestamp (preferably in milliseconds, though I wouldn't mind with and without). Mktime seems to be the method that usually gets it, however I keep getting the error: AttributeError: type object 'datetime.time' has no attribute 'mktime'. Can anyone tell me what I'm doing wrong? I keep...

Opposite of Time.now.advance() in Ruby

http://rails.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Time/Calculations.html#M001139 documents a method advance() to add to the current time. Is there an opposite, 'go_back() method? ...

DateTime property in a ConfigurationElement

I'm wanting to put a DateTime in to the config file, however, I want the DateTime expressed in a specific way. I've seen examples of using a DateTime in a ConfigurationElement (like the example below). The examples I've seen all have the date expressed in American format. I want to ensure that date is understandable by all regardless of ...

Why doesn't DateTime.ToShortTimeString() respect the Short Time format in "Regional and Language Settings"?

I have run into an issue that is probably due to my mis-understanding of how the DateTime.ToShortTimeString() method works. When formatting time strings with this function, I was assuming that it would respect the "Short Time" setting in Windows 7's Format settings Control Panel -> Clock, Language and Region -> Region and Language -> Fo...

how to detect if the current time is between 15.31 - 15.45

in dot net frame work 2 how to better this and easy to used i have many times using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class _...

how to Convert DateTime Now To second

input 15:20:30 to to convert to second ...