Search Results

Search found 15515 results on 621 pages for 'datetime format'.

Page 10/621 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Milliseconds in DateTime.Now on .NET Compact Framework always zero? [SOLVED]

    - by Marcel
    Hi all, i want to have a time stamp for logs on a Windows Mobile project. The accuracy must be in the range a hundred milliseconds at least. However my call to DateTime.Now returns a DateTime object with the Millisecond property set to zero. Also the Ticks property is rounded accordingly. How to get better time accuracy? Remember, that my code runs on on the Compact Framework, version 3.5. I use a HTC touch Pro 2 device. Based on the answer from MusiGenesis i have created the following class which solved this problem: /// <summary> /// A more precisely implementation of some DateTime properties on mobile devices. /// </summary> /// <devdoc>Tested on a HTC Touch Pro2.</devdoc> public static class DateTimePrecisely { /// <summary> /// Remembers the start time when this model was created. /// </summary> private static DateTime _start = DateTime.Now; /// <summary> /// Remembers the system uptime ticks when this model was created. This /// serves as a more precise time provider as DateTime.Now can do. /// </summary> private static int _startTick = Environment.TickCount; /// <summary> /// Gets a DateTime object that is set exactly to the current date and time on this computer, expressed as the local time. /// </summary> /// <returns></returns> public static DateTime Now { get { return _start.AddMilliseconds(Environment.TickCount - _startTick); } } }

    Read the article

  • How do you structure a 2D level format with collisions etc. in Java (Slick 2D)?

    - by liamzebedee
    I am developing a game in Java. 2D Fighter, Kind of like the 2d flash game Raze(http://armorgames.com/play/5395/raze). I currently am using the Slick 2D game library and am researching how to structure my levels. I am currently stuck on the problem of the level format(e.g. file format). How do you structure a 2d level with collisions etc.? Level Notes: Will go up down left right NOTE: New to gamedev

    Read the article

  • How do I change the date format in Gnome 3 shell?

    - by James Haigh
    I want to change the date/time format on the top panel to a format close to RFC 3339 / ISO 8601, like one of these: %F %T ? 2013-06-24 16:13:00 %F %a %T ? 2013-06-24 Mon 16:13:00 %A %F %T ? Monday 2013-06-24 16:13:00 I know Unity has a preference somewhere hidden away in dconf, this is how I did it in Unity, but I can't find such a preference for Gnome 3 shell. Preferably, I'd also like to set one of these as my system-wide date/time locale preference.

    Read the article

  • How to truncate milliseconds off of a .NET DateTime

    - by Jeff Putz
    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 the time, and when read into a .NET DateTime, it includes those milliseconds. The incoming request to the system, however, does not offer that precision, so I need to simply drop the milliseconds. I feel like I'm missing something obvious, but I haven't found an elegant way to do it (C#).

    Read the article

  • jquery function to convert datetime, split date time "2010-10-18 10:06" to return "18/10/2010" and

    - by Cesar Lopez
    Hi I was wondering if there is any jquery function around which can take this dateTime "2010-10-18 10:06" and convert and split it returning "2010/10/18" and "10:06". It would be also nice if the same function could either receive "2010-10-18 10:06" or "2010-10-18" only and return as mentioned above, or different formats besides "2010/10/18" like 18-10-2010" or and 18th of October 2010, giving the option but not that important, just curious about jQuery power dealing with dates. Thanks.

    Read the article

  • Unit Testing: DateTime.Now

    - by Pedro
    I have some unit tests that expects the 'current time' to be different than DateTime.Now and I don't want to change the computer's time, obviously. What's the best strategy to achieve this? Thanks

    Read the article

  • Coercing Json Serializer into producing a particular datetime format (yyyy-mm-ddThh:mm:ss.msmsmsZ)

    - by Chris McCall
    MyClass theSession = new MyClass() { accountId = 12345, timeStamp = DateTime.Now, userType = "theUserType" }; System.Web.Script.Serialization.JavaScriptSerializer Json = new System.Web.Script.Serialization.JavaScriptSerializer(); Response.Write(Json.Serialize(theSession)); Produces: {"accountId":12345,"timeStamp":"\/Date(1268420981135)\/","userType":"theUserType"} How can I present the date as: "timestamp":"2010-02-15T23:53:35.963Z" ?

    Read the article

  • Datetime and date-range comparsion

    - by Ockonal
    Hello guys, I have datetime-row in mysql database. I have to check time between now and that date using php. If the range is bigger then 1 month - do somtething. I tried something like this: $dateFromMysql = strtotime($rowData); $currentDate = date("m/d/y g:i A"); And then comparsion by hands. It's ugly.

    Read the article

  • How to get the Time value from datetime picker

    - by Ranjana
    how to get the time value in a stored procedure form datepicker value i.e i have a datetime picker value stored into my table as '2010-04-06 09:00:00.000' '2010-04-07 14:30:00.000' i have got the date sepeartely using convert(varchar,Date,3) as Date.. i have got the time seperately using convert(time,Time) but it show the values as 9:00 , 14:30 i need it to show as 9.00 am and 2.30pm instead of 14.30. How to achieve this????????? and help??????

    Read the article

  • How to select from datetime in sqlite?

    - by Sein Kraft
    Joined is a datetime data type column in the database and dates are saved as '12/05/2010 15:54:32' This my query: SELECT * FROM users WHERE joined BETWEEN '12/05/2010 00:00:00' AND '12/05/2010 59:59:59' ORDER BY id ASC But it doesn't work. It returns no rows. So how i gan get them?

    Read the article

  • Convert SQL server datetime fields to compare date parts only, with indexed lookups

    - by Caveatrob
    I've been doing a convert(varchar,datefield,112) on each date field that I'm using in 'between' queries in SQL server to ensure that I'm only accounting for dates and not missing any based on the time part of datetime fields. Now, I'm hearing that the converts aren't indexable and that there are better methods, in SQL Server 2005, to compare the date part of datetimes in a query to determine if dates fall in a range. What is the optimal, indexable, method of doing something like this: select * from appointments where appointmentDate='08-01-2008' and appointmentDate<'08-15-2008'

    Read the article

  • convert string of millisecond into datetime in python

    - by newbie
    I am a newbie in Python. I want to substract interval time from my log file, but the problem is I cannot convert millisecond string of log file into datetime format. For example, I have 15:55:05.12345 and I want to remove 5.12345 seconds from this string, and shwow result of 15.55.00.00000 in Python. How can I do that? Currently, I am using python 2.5. Thank you in advance.

    Read the article

  • MySQL: What's the best to use, Unix TimeStamp Or DATETIME

    - by Axel
    Hello, Probably many coders want to ask this question. it is What's the adventages of each one of those MySQL time formats. and which one you will prefer to use it in your apps. For me i use Unix timestamp because maybe i find it easy to convert & order records with it, and also because i never tried the DATETIME thing. but anyways i'm ready to change my mind if anyone tells me i'm wrong. Thanks

    Read the article

  • DateTime Format Strings?

    - by Phil
    I have the date format string dd-mm-yy. Please can you tell me how to add hours and minutes to the string (i.e 13-03-2010.21.03) .... DateTime.Today.ToString("dd-mm-yy") ?

    Read the article

  • C#: Using DateTime.Parse with string

    - by Meko
    Hi all.I am trying to get date format from Day name and time like "Monday" and second string "08:15" and it must like 10:05:2010 08:15 and then I will make subtracting from date of today. DateTime.Parse("08:15") it works but it outputs todays date. I want to get date of day name. I also usedDateTime.Parse("08:15").AddDays(1)it gaves me next days date.Here I want to get date of next Monday with and "08:15" time.

    Read the article

  • Store more than 24 hours in a DateTime

    - by Rob
    I work in a bizarre and irrational industry where we need to be able to represent the time of day as 06:00:00 to 30:00:00 instead of 0:00:00 to 24:00:00. Is there any way to do this using the DateTime type? If I try to construct a date time with an hour value greater than 24 it throws an exception.

    Read the article

  • Mysql - datetime and date-range comparsion

    - by Ockonal
    Hello guys, I have datetime-row in mysql database. I have to check time between now and that date using php. If the range is bigger then 1 month - do somtething. I tried something like this: $dateFromMysql = strtotime($rowData); $currentDate = date("m/d/y g:i A"); And then comparsion by hands. It's ugly.

    Read the article

  • Needs help regarding print in asp.net (need to remove datetime from printpage)

    - by Rajesh Rolen- DotNet Developer
    i am using below code to print my content of webpage in asp.net using javascript window.print(document.getElementById('dvPrint')); when i do print, it automatically adds date time on page.. (i think because of page setup) in firefox. please tell me how can i remove this setting. i mean i dont want datetime to be printed automatically on my print page (even if its set in pagesetup).

    Read the article

  • C# DateTime, is this method regional setting safe?

    - by JL
    I am using the following method to serialize a date as a string private const string DateFormatString = "dd.MM.yyyy HH:mm:ss"; string LastsuccessfuldownloadDateTime = DateTime.Now.AddDays(-91).ToString(DateFormatString); Is this the safest way to ensure that the string always gets serialized in this format?

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >