time

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);? ...

Given a date in UTC time, how do I know if it's currently the same day anywhere else in the world?

Suppose I have a particular UTC time T. I would like a method that returns true if it is possible that at least one spot somewhere else on Earth has the same local date as T right now. def still_same_date?(t) # true # if it is the same day at some other place on Earth # false # otherwise end For example, let's say T is tod...

Having trouble getting Joda-time to run on Android.

Hello, I'm learning Android and have need for dates/times. I was recommended Joda-time by a colleague, which seems to be exactly what I need to make progress. Unfortunately, I'm having trouble getting it to work. I'm using intellij and this is Android 2.2. Steps I took: Download the Joda-time jar from the website. Intellij > File > ...

Get Time Zone abbreviation given GMT offset with Objective C

Is there a way to lookup a timezone abbreviation when only the temporal offset is known? Example: Say i'm given the offset of GMT -5, i'd like to display the abbreviation of EST (assuming US) as apposed to GMT -5. If you initialize a NSTimeZone object with [NSTimeZone timeZoneWithName:@"America/Argentina/Buenos_Aires"], you can get th...

creating date from a timestring in javascript

hi I am new to javascript and am trying to compare two date values ,I am getting two time value strings in the format 06:30:47 AM 01:10:47 PM I need to compare these to find out if the first one is less than the other.I couldn't figure out how to do this in javascript.Can someone help? o.h ...

How do libraries in different programming languages handle Date & Time, Timestamps & Durations, Leapseconds & -years, DSTs & Timezones, ...?

Is there a standard body or a specific normative way how time-related things should be implemented in practice (like ICU for Unicode-related tasks) or is this currently a "best-effort", depending on how much effort, time and money language and library implementers want to spend? Is there a specific and complete implementation which coul...

Get hex time stamp from bash script

Hi, I would like to convert the current date and time into a hex time stamp, something like: Tue Feb 2 10:27:46 GMT 2010 converted into 0x6d054a874449e I would like to do this from a bash script, any idea how I might do that? Thanks J ...

SQL convert int to time

I have a database that displays time as an integer. However I am wanting to output this into a report with the correct format. This is the format that I would like to change: eg. 183000 would become 18:30 500 would become 00:05 160000 would become 16:00 and so on. I have had a look and CAST and CONVERT but not succefully manage...

Cross Language/Cross Platform Date and Time Transfer

What is the best way to transfer Dates and Times across. I am using GWT on the client/browser side and .NET C Sharp on the server and I am using JSON as data-interchange format. I am currently storing all the dates and times on the server as .NET DateTime. Now I have noticed, that if I use the GWT DatePicker or DateBox to pick a date and...

How do I get locale day and month?

I'm using the following function to retrieve date and time: function formatEventTime($time, $type, $locale = 'nb_NO') { setlocale(LC_TIME, $locale); switch($type) { case 'date' : $format = '%d.%m'; break; case 'dm' : $format = '%d. %B'; break; case 'time' : $format = '%H...

How can I get the Windows system time with millisecond resolution?

Hello all. How can I get the Windows system time with millisecond resolution? If the above is not possible, then how can I get the operating system start time? I would like to use this value together with timeGetTime() in order to compute a system time with millisecond resolution. Thank you in advance. ...

Issue calculating the time of the day using time()

Hello, I am writing some code to give me a history of the last commands written in a shell, including the time, in the format hour:minutes. I have the following code: // Modulo by 86400, number of seconds in a day int totalSeconds = history_time[i] % 86400; int hours = totalSeconds / 3600; int minutes = (totalSeconds % 3600) / 60; ...

unit testing time format conversions

After ncovering an ugly bug I wouldn't have caught in winter, I've started to centralize conversions between different time formats. I've already found some bugs by comparing different conversion paths, but need something more systematic. Test goals are correct conversion on all paths (of course), and errors on rimes not represented cor...

Javascript: Convert a UTC Date() object to the local timezone

Hey, I have a Date() object that contains a UTC date, which I need converted to the users local timezone. Does anybody know how I could do this? :-) Thanks in advanced! ...

Mysql how to set time data type to be only HH:MM in database

Hi, how can I set my mysql database field "time" data type to only be HH:MM in the database, in my script the user only enters HH:MM and the DB automatically adds the last :SS digits, the problem is when I pull that value to edit, it adds the last digits also, which is kind of annoying, I can get rid of it with PHP and truncating off the...

How do I convert microseconds into a timestamp?

I took this piece from an unencrypted .DAT file: Code: 00 e1 27 17 6f e6 69 c0 Which translates to 63,374,851,375,000,000 in decimal. The units for the number are microseconds. And this huge number cannot bypass the 1st January 1970 00:00:00 format; such a format that most converters use today. So, yes. Is there such a converter tha...

find all occurrences of 'can be interpreted as time'

Is there an efficient way to search a message for substrings which might represent a time? For example, this message: let's meet tomorrow at 14:30 or do you prefer 2:30pm? should return ('14:30', '2:30pm'). Finding hh:mm times can be easily achieved using a simple regex, but I'm wondering if there are existing solutions to find mo...

Object planning or user-flow planning - which should come first?

When starting a new piece of software, do you find it more helpful do plan the interface and use cases first, or outline the objects that will need to be built? I can see an argument for the former in that you have to know where you're going before you can get there. But when I say 'interface use cases', I mean VERY SPECIFIC applicatio...

how to check reach and response time from my website?

hi, i have a few websites on servers around the world. i want to find out how much time does it take from sending the request from my computer to enter the site until the site begins to load in the server, and how much time does it takes from the time the server ended the request until i see the result on my computer. thanks, yishai ...

SSAS - Facts that happened over a time range

Hi, I don't really know how to handle facts that happened over a period of time. I sually deal with facts that happened on a specific date. In clear, my facts have a start_date and an end_date. So, let's say my start_date is 01/01/2008 and my end_date is 01/01/2011. I need to get the number of those facts that happened in 2009 and thos...