datetime

Sum amount of overlapping datetime ranges in MySQL

I have a question that is almost the same as http://stackoverflow.com/questions/1148303, so I'm reusing part of his text, hope that is ok... I have a table of events, each with a StartTime and EndTime (as type DateTime) in a MySQL Table. I'm trying to output the sum of overlapping times for each type of event and the number of events t...

Converting to and from datetime adds an hour?

Hi, I am writing a fairly large webapp in asp.net / c# with mssql 2008 r2 serving the database. The program needs to convert date/time strings (in ISO date format) to DateTime where they are used and later stored as smalldatetime in sql. When the strings are converted to datetimes, an hour is mysteriously added to the result. I underst...

Getting formatted datetime in Python like in PHP

Hello, How to get formatted date time in Python the same way as in PHP date('M d Y', $timestamp);? ...

MS-Access front-end does not recognise dates from SQL Server

I have a SQL Server 2008 database with an Access front-end. My problem is that Access does not recognise SQL Server's dates as they are in a different format. SQL Server-s format is YYYY-MM-DD Access' format is DD-MM-YYYY When the date is displayed in a text-box, it is displayed as a string (without the little calendar icon next to it)...

Rails saving datetime to MySQL database

I have a simple function within my model to set a completed datetime column in a database. this function worked until I tried to change the default rails format for datetime. After reading up on the issues with mysql datetime format and rails I decided to take out the formating code I had in the environment.rb It still does not save t...

Vaadin DateField textfield does not update time value

Hi, Has anyone had any problems with the updating of the time value when using Vaadin DateField (or PopupDateField)? Whenever a new time is selected from the time drop downs located at the bottom of the popup calendar, the date textfield does not update with the new time selected. Only the day value updates properly when a different day...

Perform daily action at a specific time based on user's local time zone

My Java application needs to send an email out to all users once per day. I'd like to deliver it at approximately 2AM based on each user's local time. So a user in New York would get the message at 2AM America/New_York time. A user in Los Angeles would get the message at 2AM America/Los_Angeles time. My mailing process would run once eac...

DateTimeFormatInfo.InvariantInfo or null in ToString / TryParseExact

Hi, I'm wondering what is the difference for application between those two calls, in means of resulting DateTime object, whether TryParseExact will succeed, and result of ToString operation: DateTime.TryParseExact(value, "MMM yyyy", DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None, out conversionResult) DateTime.TryParseExact(val...

convert unix timestamp php

Hi, I have a database that stores the time for me. I insert it from PHP using date( 'Y-m-d H:i:s'); I then use this function to convert it to a unix timestamp in PHP function convert_datetime($str) { list($date, $time) = explode(' ', $str); list($year, $month, $day) = explode('-', $date); list($hour, $minute, $second) = explode('...

Get timezone name in codeigniter

I use the date helper in CI to save the timezone of the user when he signup eg: UM45. I want to set the timezone of each user based on that and display the date time correspondingly, using date_default_timezone_set(). But that accepts only string.. How can I get the name of the timezone based on UM45? ...

Counting regular working days in a given period of time

Hi guys, need some help. I need to count regular working days for a given date period, for example, in our country, we have 5 regular working days monday to friday, then in code i need to exclude saturdays and sundays when I use it on my computations. I need an algorithm something like this in C#: int GetRegularWorkingDays(DateTim...

jQuery datepicker validating date ranges between two dates in any format

Hi, This question is an extension of this one: http://stackoverflow.com/questions/3675007/jquery-datepicker-date-range-throwing-invalid-date-range-error-with-valid-dates The latest jsFiddle is located here: http://jsfiddle.net/mQRaj/7/ The issue i am having is as follows. I have two datepickers that are going to be localised into m...

Converting a Date from a String representation to a numerical representation and back again

Hello Are there any patterns or known ways of converting a date from a string representation to a numerical representation and vice versa? Background: I am using an Apache Derby database as the persistence for a Java program. I would like to do something like this: Select * from MyTable where date_column > 20100914154503 order by date...

Returning dates without times in a LINQ query

I am writing a query where I want to count the number of times our call center gets contacted by date. Seems easy enough, but since the contact date field is a datetime field I get the time, so when I group by contact date(time) each contact date instance has a count of '1'. So, I want to group by just the date without the time. Below...

Highcharts - show every other x-axis category

I have Highcharts set up to display a graph with a bunch of xAxis categories. This is all working fine, but I would like to be able to skip some of the xAxis categories, so not everything one is shown. You can see an example of this working within Campaign Monitor's reporting section (screenshot: http://screencast.com/t/Y2FjNzQ4Y). Any ...

Best logic to select/restrict correct date from range - .net

Hi, Apologies for using someone else's brain for this, but I'm sure this is a common problem and has some sort of design pattern solution that I've not come across before. I have an IList of objects that each have a "start" and a "stop" date. These date ranges can overlap. What I need to do is select which object is current for today's...

DateTimeFormat Issue

I dont get following desired output from a DateTime-Object: 2010-03-29 13:15:00 My default localization is de-DE, so a simple ToString gives me: 29.03.2010 13:15:00 What I've tried is to create a DateTimeFormatInfo Object from US-Culture and use its DateTimePatterns but without success: Dim usDateFormat As Globalization.Date...

C#: Adding working days from a cetain date.

I have trouble doing this. I'm creating a method that add working days on a specific date. for example, I want to add 3 working days to sept 15, 2010 (Wednesday), the method would return sept 20 (Monday next week). it disregards saturday and sunday because its non-working day.. Something like this in C#: DateTime AddWorkingDays(DateTim...

DateTime.Now Off By An Hour On Coworker's Computer

Hi, I have a program that posts Datetime.Now(), but my coworkers computer's DateTime.Now() is off by an hour. He changed it in his windows Date and Time Properties, but he is still posting a DateTime.Now() that is an hour off. How can I fix this on his box without making modifications to my program (I have too many projects going on...

python date interval intersection

dear all, As a matter of general interest I'm wondering if there's a more elegant/efficient way to do this. I have a function that compares two start/end tuples of dates returning true if they intersect. from datetime import date def date_intersection(t1, t2): t1start, t1end = t1[0], t1[1] t2start, t2end = t2[0], t2[1] if ...