datetime

How do I convert eg '22/03/2005' to a datetime in SQL Server

Its SQL Server 2000. I am starting with a character string in the format DD/MM/YYYY ...

Coneverting Time in UTC to Pacific time in ruby?

Hi i get a string from a external method with a time and date like so "07/09/10 14:50" is there any way i can convert that time in ruby to 'Pacific US' time knowing its 'UTC' time? with changes accounted for in the date? i.e if the time difference results in the day being different. thanks ...

which one faster, getimeofday or clock_gettime ?

I want to store event time. I found these two functions, but don't know which one is faster. ...

How Find timezone and return time with DaylightSavingTime applied?

Hello I'm trying to Find a timezone and return time with DaylightSavingTime applied? Currenty I can: find the time zone get utc offset calculate the local time based on that determine if the time zone uses DaylightSavingTime get the rules for DaylightSavingTime determine if the current time uses DaylightSavingTime However I'm hav...

How to Customize the time format for Python logging?

I am new to Python's logging package and plan to use it for my project. I would like to customize the time format to my taste. Here is a short code I copied from a tutorial: import logging # create logger logger = logging.getLogger("logging_tryout2") logger.setLevel(logging.DEBUG) # create console handler and set level to debug ch = l...

Check out that date is included in the period then 10 days following

Hello! I have a variable $ node-> field_work_start [0] ['view'] which denotes the date of birth. To follow up I want to do a background check on the fact that this date is included in the next period then 10 days from the current date. If true then x = 1, false x = 0. Help please with code PHP. ...

Getting all DateTimes between two DateTime in c#

Hello. I have two DateTime, and I want to get all DateTimes between these Dates. Such as, if my Dates are like 01.01.2010 - 05.01.2010, my function should return me a list of date (List) and it must contains 01.01.2010, 02.01.2010, 03.01.2010, 04.01.2010, 05.01.2010 I wrote a function like this. It works fine, if my dates in a month. It ...

Are UtcNow and Now the same datetime? Do they know they're different?

If I run a snippet like: bool areTheyTheSame = DateTime.UtcNow == DateTime.Now what will I get? Does the DateTime returned know its timezone such that I can compare? My specific problem is that I'm trying to build a cache-like API. If it takes a DateTime AbsoluteExpiration, do I have to enforce that users of my API know whether t...

How can I format display of a DATETIME column in ISQL Perform?.. and other 4.10 related questions

Informix-SE 4.10.DD6, Informix-SQL 4.10.DC1 Perform screen: 1) I have column defined as DATETIME HOUR TO MINUTE and when I display it in ISQL Perform screen its default format is HH:MM (24-hour time). I would like to display it as HH:MM (am/pm). Perform format attribute only applies to DATE and DECIMAL datatypes. How can I format displa...

Why is this returning -1 in JavaScript

d.getTime().toString().search(/Wed/i) I don't get it... typeof returns string, and if i copy and paste "Wed Jul 14 2010 15:35:53 GMT-0700 (PST)" and save it to the var str and do str.search(/Wed/i) it returns 0 but when i do it like above i always get -1, even tho, as i said, it returns a string typeof. Any ideas how to check if Wed i...

Getting date-time in locale format in asp.net

Hello friends, I have a web application developed in asp.net 3.5. The application is used in India only while it is hosted on US servers. The problem here is that i want to show the date and time according to India timezone. When i am using DateTime.Now.ToString() i am getting the date and time of server with US format i.e. MM/dd/yyyy h...

Zend_Date returning strange format online - works fine on my localhost

I have the following code to format dates: $date = new Zend_Date(); $date->set(strtotime($some_date); echo ($date->get(Zend_Date::DATE_FULL)); it wokrs fine on my localhost outputting the date as I need it to be outputted. However on my online server the dates are outputted in a weird numerical way. i.e the numeric value fo the Day a...

Javascript: How do I convert a specific timezoned date to different time zone date?

I have a php script which gives server time, but as per knowledge, we can get the user's machine time and time zone with the help of client side scripts (javascript). I have mysql table which has dates stored along with timezone from where it was stored with the help of form. I need to show the data on a web page along with the time stor...

Oracle: Selecting all records where the table's date fields' hour and minute value are set to certain value

I have a table in a Oracle database containing a date field EXPIRYDATE. I would need to select all records from the table, where the hour and minute portion of the date field are set to 0 (i.e. midnight). How can I achieve this? I tried with the extract function (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions0...

How to increment the day in datetime? Python.

How to increment the day in datetime? In python. for i in xrange(1,5) date=datetime.datetime(2003,8,i,12,4,5) print date But i need pass through years? Any ideas? Should be easyier way.... ...

Excel decimal format to C# DateTime

In my C# Data Access Layer...I am retrieving a dataset from Excel ...and there is a decimal excel field which returns date in the format : 20090701. I need this to be converted to C# DateTime. What is the best way to do it? ...

Trouble comparing two PHP variables

Hello, this may seem like a stupid question, but it is stumping me nontheless. I'm sure that the answer is something small. I think it's just one of those situations where I have been looking at the code for too long. I am trying to compare two PHP variables to see if they are the same. As you can see below, I am comparing $verification...

Get the time corresponding to the start of the current calendar month

How can I get a Time object corresponding to the start of the current calendar month? E.g., if I ran the function today I'd get a Time object for 7/1/2010 at midnight Bonus question: How can I do the same thing for the current week? If I ran this function today I'd get a Time object for 7/11/2010 at midnight ...

How to Convert to UTC

I'm getting dates & times from various sources (e.g. file's date/time from FTP server, email's date/tiem received, etc.) and need to store them all as UTC (so they all have a common reference). How do I do this? What pieces of information do I need in order to properly do the conversion. This is for a PHP web application. So, I can get ...

PHP MySQL Query most popular in last 24 hours

Say I want to get ten records with the MOST likes in the last 24 hours. Here's what I have so far: $date = date("o-m-d"); $query = "SELECT date_created,COUNT(to),from,to FROM likes WHERE date_created LIKE '$date%' GROUP BY to ORDER BY COUNT(to) DESC LIMIT 10"; The problem with that is that it only gets the most liked from THAT DAY, no...