Search Results

Search found 67120 results on 2685 pages for 'date time'.

Page 5/2685 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • PHP: producing relative date/time from timestamps

    - by KeyStroke
    Hi, I'm basically trying to convert a Unix timestamp (the time() function) to a relative date/time that's both compatible with past and future date. So outputs could be: 2 weeks ago 1 hour and 60 minutes ago 15 minutes and 54 seconds ago after 10 minutes and 15 seconds First I tried to code this, but made a huge unmaintainable function, and then I searched the internet for a couple of hours, yet all I can find are scripts that produce only one part of the time (e.h: "1 hour ago" without the minutes). Do you have a script that already does this? If so, I'd really appreciate if you could share it. Thanks.

    Read the article

  • C# Date Time Picker to Text?

    - by user3691826
    Im trying to get a text from a file into date format for a label. What i currently have works great for a DateTimePicker however im wanting to now use a label to display the date rather than a DateTimePicker. This is what currently works when getting the value to a DateTimePicker: dateTimeMFR.Value = this.myKeyVault.MFRDate; and this is what im attempting to make work in a label: DateTimePicker myDate = new DateTimePicker(); myDate.Value = myKeyVault.MFRDate; txtMFR.Text = myDate.Text; Thanks for any help on the matter.

    Read the article

  • Ptyhon date string to date object

    - by elif
    Hi all, How do I convert a string to a date object in python? The string would be: "24052010" (corresponding to the format: "%d%m%Y") I DON'T want a datetime object. I suspect that I'm asking a trivial question but I searched and couldn't find it neither on stackoverflow nor on google. Thank you, Elif

    Read the article

  • Compare two times without regard to Date associated - Ruby

    - by H55nick
    I am trying to find the difference in time (without days/years/months) of two different days. Example: #ruby >1.9 time1 = Time.now - 1.day time2 = Time.now #code to make changes #test: time1 == time2 # TRUE My solution: time1 = time1.strftime("%h:%m").to_time time2 = time2.strftime("%h:%m").to_time #test time1 == time2 #True #passes I was wondering if there was a better way of doing this? Maybe we could keep the Date the same as time1/time2?

    Read the article

  • Oracle Date Format Convert Hour-Minute to Interval and Disregard Year-Month-Day

    - by dlite922
    I need to compare an event's half-way midpoint between a start and stop time of day. Right now i'm converting the dates you see on the right, to HH:MM and the comparison works until midnight. the query says: WHERE half BETWEEN pStart and pStop. As you can see below, pStart and pStap have January 1st 2000 dates, this is because the year month day are not important to me... Valid Data: +-------+--------+-------+---------------------+---------------------+---------------------+ | half | pStart | pStop | half2 | pStart2 | pStop2 | +-------+--------+-------+---------------------+---------------------+---------------------+ | 19:00 | 19:00 | 23:00 | 2012-11-04 19:00:00 | 2000-01-01 19:00:00 | 2000-01-01 23:00:00 | | 20:00 | 19:00 | 23:00 | 2012-11-04 20:00:00 | 2000-01-01 19:00:00 | 2000-01-01 23:00:00 | | 21:00 | 19:00 | 23:00 | 2012-11-04 21:00:00 | 2000-01-01 19:00:00 | 2000-01-01 23:00:00 | | 23:00 | 20:00 | 23:00 | 2012-11-05 23:00:00 | 2000-01-01 20:00:00 | 2000-01-01 23:00:00 | +-------+--------+-------+---------------------+---------------------+---------------------+ Now observe what happens when pStop is midnight or later... Valid Data that breaks it: +-------+--------+-------+---------------------+---------------------+---------------------+ | half | pStart | pStop | half2 | pStart2 | pStop2 | +-------+--------+-------+---------------------+---------------------+---------------------+ | 23:00 | 22:00 | 00:00 | 2012-11-04 23:00:00 | 2000-01-01 22:00:00 | 2000-01-01 00:00:00 | | 23:30 | 23:00 | 02:00 | 2012-11-05 23:30:00 | 2000-01-01 23:00:00 | 2000-01-01 02:00:00 | +-------+--------+-------+---------------------+---------------------+---------------------+ Thus my where clause translates to: WHERE 19:00 BETWEEN 22:00 AND 00:00 ...which returns false and I miss those two correct rows above. Question: Is there a way to show those dates as integer interval so that saying half BETWEEN pStart and pStop are correct? I thought about adding 24 when pStop is less than pStart to make 00:00 into 24:00 but don't know an easy way to do that without long string concatenations and number conversions. This would solve the problem because pStart pStop difference will never be longer than 6 hours. Note: (The Query is much more complex. It has other irrelevant date calculations, but the result are show above. DATE_FORMAT(%H:%i) is applied to the first three columns and no formatting to the last three) Thanks for your help:

    Read the article

  • UIDatePicker date method is picking wrong date: iPhone Dev

    - by prd
    Hi, I am getting very strange behaviour on UIDatePicker. I have a view with date picker declared in .h file as IBOutlet UIDatePicker *datePicker; with property nonatomic and retain. datePicker is properly linked in IB file. In the code I am setting the minimum, maximum, initial date and action to call for UICOntrolEventValueChanged using following code If (!currentDate) { initialDate = [NSDate date]; } else { initialDate = currentdate; } [datePicker setMinimumDate:[NSDate date]]; [datePicker setMaximumDate:[[NSDate date] addTimeInterval:5 * 365.25 * 24 * 60 * 60]]; // to get upto 5 years [datePicker setDate:initialDate animated:YES]; [datePicker addTarget:self action:@selector(getDatePickerValue:) forControlEvents:UIControlEventValueChanged]; In getDatePickerValue, I get the new date using datePicker.date. When the view is closed (using a done button), I get the current value of the date using datePicker.date. Now if the view is called with no 'currentDate', the picker returns 'todays date'. This is what happens the 'first' time my pickerView is called. Each subsequent call to the view, with no 'current date' gives me a different and later date from today. So, first time I get today's date say 9 Jun 2010 second time datePicker.date returns 10 Jun 2010 third time 11 Jun 2010 and so on. Though its not always incremental, but mostly it is. I have put NSLogs, and verified the initial date is set correctly. The problem is only on the device (on OS 3.0), the issue is not replicated on simulator. I can't find what I have done wrong. I hope somebody else has come across similar problem and can help me resolve this.

    Read the article

  • linux bash script: set date/time variable to auto-update (for inclusion in file names)

    - by user1859492
    Essentially, I have a standard format for file naming conventions. It breaks down to this: target_dateUTC_timeUTC_tool So, for instance, if I run tcpdump on a target of 'foo', then the file would be foo_dateUTC_timeUTC_tcpdump. Simple enough, but a pain for everyone to constantly (and consistently) enter... so I've tried to create a bash script which sets system variables like so: FILENAME=$TARGET\_$UTCTIME\_$TOOL Then, I can just call the variable at runtime, like so: tcpdump -w $FILENAME.lpc All of this works like a champ. I've got a menu-driven .sh which gives the user the options of viewing the current variables as well as setting them... file generation is a breeze. Unfortunately, by setting the date/time variable, it is locked to the value at the time of creation (naturally). I set the variable like so: UTCTIME=$(/bin/date --utc +"%Y%m%d_%H%M%Z") What I really need is either a way to create a variable which updates at runtime, or (more likely) another way to skin this cat. While scouring for solutions, I came across a similar issues... like this. But, to be honest, I'm stumped on how to marry the two approaches and create a simple, distributable solution. I can post the entire .sh if anyone cares to review (about 120 lines)

    Read the article

  • Formating Date in Freemarker to say "Today", "Yesterday", etc.

    - by egervari
    Is there a way in freemarker to compare dates to test if the date is today or yesterday... or do I have to write code in Java to do these tests? I basically want to do this: <#------------------------------------------------------------------------------ formatDate -------------------------------------------------------------------------------> <#macro formatDate date showTime=true> <#if date??> <span class="Date"> <#if date?is_today> Today <#elseif date?is_yesterday> Yesterday <#else> ${date?date} </#if> </span> <#if showTime> <span class="Time">${date?time}</span> </#if> </#if> </#macro> EDIT: My best guess to implement this is to pass "today" and "yesterday" into the model for the pages that use this function and then compare the date values against these 2 objects in the model. I am out of out of options, but I'd rather not have to do this for every page that uses this macro. Any other options that are nicer? <#if date??> <span class="Date"> <#if date?date?string.short == today?date?string.short> Today <#elseif date?date?string.short == yesterday?date?string.short> Yesterday <#else> ${date?date} </#if> </span> <#if showTime> <span class="Time">${date?time}</span> </#if> </#if>

    Read the article

  • Covert time format in php

    - by brandon14_99
    How would I covert a date formatted like this Thu, 08 Jul 2010 15:51:01 into a date like this Thursday July 8th, 2010 3:51 pm. Also, how would I filter the first sting to not include time, so that it could look like this in the end Thursday July 8th, 2010

    Read the article

  • Calculate date from numeric value

    - by elias
    The number 71867806 represents the present day, with the smallest unit of days. How can I calculate the currente date from it? (or) convert it into an Unix timestamp? Solution shouldn't use language depending features. Thanks!

    Read the article

  • Change the format of the date column in Thunderbird

    - by TheOmega
    I want to change the format of the "Date"-column in the messagelist in Thunderbird. For mails from today, I want to display only the time, not the date. For mails from before today, I want to display only the date, not the time. This is the same setup mutt uses. I know of the Date display format wiki article, which describes how to change the date format, but you can only switch between five predefined formats, and none of them is "Date only". I also know of the ConfigDate extension, but it's got the same limitations, you can't define a new date format.

    Read the article

  • Time management and self improvement

    - by Filip
    I hope I can open a discussion on this topic as this is not a specific problem. It's a topic I hope to get some ideas on how people in similar situation as mine manage their time. OK, I'm a single developer on a software project for the last 6-8 months. The project I'm working on uses several technologies, mainly .net stuff: WPF, WF, NHibernate, WCF, MySql and other third party SDKs relevant for the project nature. My experience and knowledge vary, for example I have a lot of experience in WPF but much less in WCF. I work full time on the project and im curios on how other programmers which need to multi task in many areas manage their time. I'm a very applied type of person and prefer to code instead of doing research. I feel that doing research "might" slow down the progress of the project while I recognize that research and learning more in areas which I'm not so strong will ultimately make me more productive. How would you split up your daily time in productive coding time and time to and experiment, read blogs, go through tutorials etc. I would say that Im coding about 90%+ of my day and devoting some but very little time in research and acquiring new knowledge. Thanks for your replies. I think I will adopt a gradual transition to Dominics block parts. I kinda knew that coding was taking up way to much of my time but it feels good having a first version of the project completed and ready. With a few months of focused hard work behind me I hope to get more time to experiment and expand my knowlegde. Now I only hope my boss will cut me some slack and stop pressuring me for features...

    Read the article

  • Daylight Saving Time Visualized

    - by Jason Fitzpatrick
    When you map out the Daylight Saving Time adjusted sunrise and sunset times over the course of the year, an interesting pattern emerges. Chart designer Germanium writes: I tried to come up with the reason for the daylight saving time change by just looking at the data for sunset and sunrise times. The figure represents sunset and sunrise times thought the year. It shows that the daylight saving time change marked by the lines (DLS) is keeping the sunrise time pretty much constant throughout the whole year, while making the sunset time change a lot. The spread of sunrise times as measured by the standard deviation is 42 minutes, which means that the sunrise time changes within that range the whole year, while the standard deviation for the sunset times is 1:30 hours. Whatever the argument for doing this is, it’s pretty clear that reason is to keep the sunrise time constant. You can read more about the controversial history of Daylight Saving Time here. Daylight Saving Time Explained [via Cool Infographics] 6 Ways Windows 8 Is More Secure Than Windows 7 HTG Explains: Why It’s Good That Your Computer’s RAM Is Full 10 Awesome Improvements For Desktop Users in Windows 8

    Read the article

  • Time Tracking on an Agile Team

    - by Stephen.Walther
    What’s the best way to handle time-tracking on an Agile team? Your gut reaction to this question might be to resist any type of time-tracking at all. After all, one of the principles of the Agile Manifesto is “Individuals and interactions over processes and tools”.  Forcing the developers on your team to track the amount of time that they devote to completing stories or tasks might seem like useless bureaucratic red tape: an impediment to getting real work done. I completely understand this reaction. I’ve been required to use time-tracking software in the past to account for each hour of my workday. It made me feel like Fred Flintstone punching in at the quarry mine and not like a professional. Why You Really Do Need Time-Tracking There are, however, legitimate reasons to track time spent on stories even when you are a member of an Agile team.  First, if you are working with an outside client, you might need to track the number of hours spent on different stories for the purposes of billing. There might be no way to avoid time-tracking if you want to get paid. Second, the Product Owner needs to know when the work on a story has gone over the original time estimated for the story. The Product Owner is concerned with Return On Investment. If the team has gone massively overtime on a story, then the Product Owner has a legitimate reason to halt work on the story and reconsider the story’s business value. Finally, you might want to track how much time your team spends on different types of stories or tasks. For example, if your team is spending 75% of their time doing testing then you might need to bring in more testers. Or, if 10% of your team’s time is expended performing a software build at the end of each iteration then it is time to consider better ways of automating the build process. Time-Tracking in SonicAgile For these reasons, we added time-tracking as a feature to SonicAgile which is our free Agile Project Management tool. We were heavily influenced by Jeff Sutherland (one of the founders of Scrum) in the way that we implemented time-tracking (see his article http://scrum.jeffsutherland.com/2007/03/time-tracking-is-anti-scrum-what-do-you.html). In SonicAgile, time-tracking is disabled by default. If you want to use this feature then the project owner must enable time-tracking in Project Settings. You can choose to estimate using either days or hours. If you are estimating at the level of stories then it makes more sense to choose days. Otherwise, if you are estimating at the level of tasks then it makes more sense to use hours. After you enable time-tracking then you can assign three estimates to a story: Original Estimate – This is the estimate that you enter when you first create a story. You don’t change this estimate. Time Spent – This is the amount of time that you have already devoted to the story. You update the time spent on each story during your daily standup meeting. Time Left – This is the amount of time remaining to complete the story. Again, you update the time left during your daily standup meeting. So when you first create a story, you enter an original estimate that becomes the time left. During each daily standup meeting, you update the time spent and time left for each story on the Kanban. If you had perfect predicative power, then the original estimate would always be the same as the sum of the time spent and the time left. For example, if you predict that a story will take 5 days to complete then on day 3, the story should have 3 days spent and 2 days left. Unfortunately, never in the history of mankind has anyone accurately predicted the exact amount of time that it takes to complete a story. For this reason, SonicAgile does not update the time spent and time left automatically. Each day, during the daily standup, your team should update the time spent and time left for each story. For example, the following table shows the history of the time estimates for a story that was originally estimated to take 3 days but, eventually, takes 5 days to complete: Day Original Estimate Time Spent Time Left Day 1 3 days 0 days 3 days Day 2 3 days 1 day 2 days Day 3 3 days 2 days 2 days Day 4 3 days 3 days 2 days Day 5 3 days 4 days 0 days In the table above, everything goes as predicted until you reach day 3. On day 3, the team realizes that the work will require an additional two days. The situation does not improve on day 4. All of the sudden, on day 5, all of the remaining work gets done. Real work often follows this pattern. There are long periods when nothing gets done punctuated by occasional and unpredictable bursts of progress. We designed SonicAgile to make it as easy as possible to track the time spent and time left on a story. Detecting when a Story Goes Over the Original Estimate Sometimes, stories take much longer than originally estimated. There’s a surprise. For example, you discover that a new software component is incompatible with existing software components. Or, you discover that you have to go through a month-long certification process to finish a story. In those cases, the Product Owner has a legitimate reason to halt work on a story and re-evaluate the business value of the story. For example, the Product Owner discovers that a story will require weeks to implement instead of days, then the story might not be worth the expense. SonicAgile displays a warning on both the Backlog and the Kanban when the time spent on a story goes over the original estimate. An icon of a clock is displayed. Time-Tracking and Tasks Another optional feature of SonicAgile is tasks. If you enable Tasks in Project Settings then you can break stories into one or more tasks. You can perform time-tracking at the level of a story or at the level of a task. If you don’t break a story into tasks then you can enter the time left and time spent for the story. As soon as you break a story into tasks, then you can no longer enter the time left and time spent at the level of the story. Instead, the time left and time spent for a story is rolled up from its tasks. On the Kanban, you can see how the time left and time spent for each task gets rolled up into each story. The progress bar for the story is rolled up from the progress bars for each task. The original estimate is never rolled up – even when you break a story into tasks. A story’s original estimate is entered separately from the original estimates of each of the story’s tasks. Summary Not every Agile team can avoid time-tracking. You might be forced to track time to get paid, to detect when you are spending too much time on a particular story, or to track the amount of time that you are devoting to different types of tasks. We designed time-tracking in SonicAgile to require the least amount of work to track the information that you need. Time-tracking is an optional feature. If you enable time-tracking then you can track the original estimate, time left, and time spent for each story and task. You can use time-tracking with SonicAgile for free. Register at http://SonicAgile.com.

    Read the article

  • How to parse date from string ?

    - by Harikrishna
    I want to parse the date from the string where date formate can be any of different format. Now to match date we can use DateTime.TryParseExact and we can define format as we needed and date will be matched for any different format. string[] formats = {"MMM dd yyyy"}; DateTime dateValue; string dateString = "May 26 2008"; if (DateTime.TryParseExact(dateString, formats, new CultureInfo("en-US"), DateTimeStyles.None, out dateValue)) MessageBox.Show(dateValue.ToString()); This matches with date.But this is not working for parse the date from the string that is it does not matched with the date which is in some string. Like if the date is "May 26 2008" then we can define format "MMM dd yyyy" and date will be matched. But if date is in some string like "Abc May 26 2008" then date will not be matched.So for that can we use regular expression here ? If yes how ?

    Read the article

  • R adding infrequent date 'events' to a time series plot

    - by flyingcrab
    Hi, I am just starting on R - and have hit a bit of a deadlock with some time series data. I have a time series (date and value) in 'zoo' format, that I want to annotate with a cross when an event occurs. The events are irregular and in a csv format (just the dates, sometimes repeated). I've managed to read in the dates etc into a format that R accepts - but i cant seem to get a means to chart the main time series with the secondary events annotated on top?

    Read the article

  • Sql Server string to date conversion

    - by JosephStyons
    I want to convert a string like this: '10/15/2008 10:06:32 PM' into the equivalent DATETIME value in Sql Server. In Oracle, I would say this: TO_DATE('10/15/2008 10:06:32 PM','MM/DD/YYYY HH:MI:SS AM') This question implies that I must parse the string into one of the standard formats, and then convert using one of those codes. That seems ludicrous for such a mundane operation. Is there an easier way?

    Read the article

  • Convert 12hour time to 24Hour time

    - by RwardBound
    I have hourly weather data. I've seen the function examples from here: http://casoilresource.lawr.ucdavis.edu/drupal/node/991 I'm altering the code to account for airport data, which has a different URL type. Another issue with the airport weather data is that the time data is saved in 12 hour format. Here is a sample of the data: 14 10:43 AM 15 10:54 AM 16 11:54 AM 17 12:07 PM 18 12:15 PM 19 12:54 PM 20 1:54 PM 21 2:54 PM Here's what I attempted: (I see that using just 'PM' isn't careful enough because any times between 12 and 1 pm will be off if they go through this alg) date<-Sys.Date() data$TimeEST<-strsplit(data$TimeEST, ' ') for (x in 1:35){ if('AM' %in% data$TimeEST[[x]]){ gsub('AM','',data$TimeEST[[x]]) data$TimeEST[[x]]<-str_trim(data$TimeEST[[x]]) data$TimeEST[[x]]<-str_c(date,' ',data$TimeEST[x],':',data$TimeEST[2]) } else if('PM' %in% data$TimeEST[[x]]){ data$TimeEST[[x]]<-gsub('PM', '',data$TimeEST[[x]]) data$TimeEST[[x]]<-strsplit(data$TimeEST[[x]], ':') data$TimeEST[[x]][[1]][1]<-as.integer(data$TimeEST[[x]][[1]][1])+12 data$TimeEST[[x]]<-str_trim(data$TimeEST[[x]][[1]]) data$TimeEST[[x]]<-str_c(date, " ", data$TimeEST[[x]][1],':',data$TimeEST[[x]][2]) } } Any help?

    Read the article

  • get the current time in C

    - by Antrromet
    I want to get the current time of my system. For that i'm using the following code in C. time_t now; struct tm *mytime = localtime(&now); if ( strftime(buffer, sizeof buffer, "%X", mytime) ) { printf("time1 = \"%s\"\n", buffer); } But the problem of this code is that its giving some random time.Also the random time is different all the time.I want the current time of my system. Can anyone please tell me how to solve this issue?

    Read the article

  • converting a UTC time to a local time zone in Java

    - by aloo
    I know this subject has been beaten to death but after searching for a few hours to this problem I had to ask. My Problem: do calculations on dates on a server based on the current time zone of a client app (iphone). The client app tells the server, in seconds, how far away its time zone is away from GMT. I would like to then use this information to do computation on dates in the server. The dates on the server are all stored as UTC time. So I would like to get the HOUR of a UTC Date object after it has been converted to this local time zone. My current attempt: int hours = (int) Math.floor(secondsFromGMT / (60.0 * 60.0)); int mins = (int) Math.floor((secondsFromGMT - (hours * 60.0 * 60.0)) / 60.0); String sign = hours > 0 ? "+" : "-"; Calendar now = Calendar.getInstance(); TimeZone t = TimeZone.getTimeZone("GMT" + sign + hours + ":" + mins); now.setTimeZone(t); now.setTime(someDateTimeObject); int hourOfDay = now.get(Calendar.HOUR_OF_DAY); The variables hour and mins represent the hour and mins the local time zone is away from GMT. After debugging this code - the variables hour, mins and sign are correct. The problem is hourOfDay does not return the correct hour - it is returning the hour as of UTC time and not local time. Ideas?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >