tagged [datetime]

How do i convert HH:MM:SS into just seconds using C#.net?

How do i convert HH:MM:SS into just seconds using C#.net? Is there a tidy way of doing this rather than doing a split on the colon's and multipling out each section the relevant number to calculate th...

25 Mar at 15:16

Python speed testing - Time Difference - milliseconds

Python speed testing - Time Difference - milliseconds What is the proper way to compare 2 times in Python in order to speed test a section of code? I tried reading the API docs. I'm not sure I underst...

Linq to SQL DateTime values are local (Kind=Unspecified) - How do I make it UTC?

Linq to SQL DateTime values are local (Kind=Unspecified) - How do I make it UTC? Isn't there a (simple) way to tell Linq To SQL classes that a particular DateTime property should be considered as UTC ...

5 May at 04:16

Where's the DateTime 'Z' format specifier?

Where's the DateTime 'Z' format specifier? [: ] I've been trying to perform roundtrip DateTime conversions with a format string that uses 'zzz' format specifier, which I know is bound to local time. S...

7 May at 06:38

What is the (best) way to handle dates before Christ in C#/.NET?

What is the (best) way to handle dates before Christ in C#/.NET? Is there any built-in support for that? And if not, is there any consensus about handling such dates? --- Links to owncoded solutions, ...

18 May at 13:5

Convert a date and time into a MS SQL select query using SelectParameters

Convert a date and time into a MS SQL select query using SelectParameters I have this situation where I have a SqlDatasource control and the select query is like: The source of @date is a label with t...

29 May at 11:37

How do I convert an interval into a number of hours with postgres?

How do I convert an interval into a number of hours with postgres? Say I have an interval like in postgres. How do I convert that to a number of hours (106 in this case?) Is there a function or should...

4 Jun at 19:8

Java Timestamp - How can I create a Timestamp with the date 23/09/2007?

Java Timestamp - How can I create a Timestamp with the date 23/09/2007? How can I create a Timestamp with the date 23/09/2007?

10 Jun at 11:22

End of month calculations

End of month calculations Just wondering if any know of an elegant solution for the following. If I have 30 June 2009 and I add a month I want it to go to 31 July 2009, not the 30 July 2009. This logi...

11 Jun at 02:0

How to represent a DateTime in Excel

How to represent a DateTime in Excel What is the best way of representing a `DateTime` in Excel? We use Syncfusions [Essential XlsIO](http://www.syncfusion.com/products/back-office/xlsio) to output va...

11 Jun at 15:1

Format .NET DateTime "Day" with no leading zero

Format .NET DateTime "Day" with no leading zero For the following code, I would expect to equal 2, because the MSDN states that 'd' "Represents the day of the month as a number from 1 through 31. A si...

12 Jun at 18:48

Creating a range of dates in Python

Creating a range of dates in Python I want to create a list of dates, starting with today, and going back an arbitrary number of days, say, in my example 100 days. Is there a better way to do it than ...

14 Jun at 18:3

How to truncate milliseconds off of a .NET DateTime

How to truncate milliseconds off of a .NET DateTime I'm trying to compare a time stamp from an incoming request to a database stored value. SQL Server of course keeps some precision of milliseconds on...

17 Jun at 01:43

Error inserting data using SqlBulkCopy

Error inserting data using SqlBulkCopy I'm trying to batch insert data into SQL 2008 using `SqlBulkCopy`. Here is my table: ``` IF OBJECT_ID(N'statement', N'U') IS NOT NULL DROP TABLE [statement] GO C...

WPF XAML StringFormat DateTime: Output in wrong culture?

WPF XAML StringFormat DateTime: Output in wrong culture? I'm having some trouble with the output of a DateTime value. My computer's current culture is set to de-AT (Austria). The following code result...

30 Jun at 07:7

How to get difference between two dates in Year/Month/Week/Day?

How to get difference between two dates in Year/Month/Week/Day? How to get difference between two dates in Year/Month/Week/Day in an efficient way? eg. difference between two dates is 1 Year, 2 Months...

5 Jul at 16:51

Retrieving a DateTime value from a DataRow (C#)

Retrieving a DateTime value from a DataRow (C#) How can I get `DateTime` value in C# from row, the current code is giving me error any help is appreciated, the data is coming in from progress database...

9 Jul at 21:54

Ordering nullable DateTime in Linq to SQL

Ordering nullable DateTime in Linq to SQL I have started using Linq to SQL for a project im working on and i have run into a problem when ordering by a DateTime field but since the DateTime allows nul...

10 Jul at 06:12

C#: Making sure DateTime.Now returns a GMT + 1 time

C#: Making sure DateTime.Now returns a GMT + 1 time I am using `DateTime.Now` to show something according to today's date, and when working locally (Malta, Europe) the times appear correctly (obviousl...

10 Jul at 09:38

How to format a java.sql Timestamp for displaying?

How to format a java.sql Timestamp for displaying? How do I formate a java.sql Timestamp to my liking ? ( to a string, for display purposes)

20 Jul at 23:14

Localizing Date Ranges

Localizing Date Ranges Does anyone know how to localize date ranges using C#? In particular, I want to generate "smart" date ranges, so that redundant information is eliminated. Here are some examples...

22 Jul at 05:59

How do I improve the performance of code using DateTime.ToString?

How do I improve the performance of code using DateTime.ToString? In my binary to text decoding application (.NET 2.0) I found that the line: takes 33% of total processing time. Does anyone have any i...

24 Jul at 08:17

Is there any difference between DateTime in c# and DateTime in SQL server?

Is there any difference between DateTime in c# and DateTime in SQL server? Is there any difference between DateTime in c# and DateTime in SQL server?

25 Jul at 09:3

Get the date of next monday, tuesday, etc

Get the date of next monday, tuesday, etc I would like to find the date stamp of monday, tuesday, wednesday, etc. If that day hasn't come this week yet, I would like the date to be this week, else, ne...

27 Jul at 15:9

How to loop between two dates

How to loop between two dates I have a calendar which passes selected dates as strings into a method. Inside this method, I want to generate a list of all the dates starting from the selected start da...

29 Jul at 09:59