Search Results

Search found 12421 results on 497 pages for 'date arithmetic'.

Page 31/497 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • Boost Date_Time problem compiling a simple program

    - by Andry
    Hello! I'm writing a very stupid program using Boost Date_Time library. int main(int srgc, char** argv) { using namespace boost::posix_time; date d(2002,Feb,1); //an arbitrary date ptime t1(d, hours(5)+nanosec(100)); //date + time of day offset ptime t2 = t1 - minutes(4)+seconds(2); ptime now = second_clock::local_time(); //use the clock date today = now.date(); //Get the date part out of the time } Well I cannot compile it, compiler does not recognize a type... Well I used many features of Boost libs like serialization and more... I correctly built them and, looking in my /usr/local/lib folder I can see that libboost_date_time.so is there (a good sign which means I was able to build that library) When I compile I write the following: g++ -lboost_date_time main.cpp But the errors it showed me when I specify the lib are the same of those ones where I do not specify any lib. What is this? Anyone knows? The error is main.cpp: In function ‘int main(int, char**)’: main.cpp:9: error: ‘date’ was not declared in this scope main.cpp:9: error: expected ‘;’ before ‘d’ main.cpp:10: error: ‘d’ was not declared in this scope main.cpp:10: error: ‘nanosec’ was not declared in this scope main.cpp:13: error: expected ‘;’ before ‘today’

    Read the article

  • Excel VBA creating a new column with formula

    - by Amatya
    I have an excel file with a column which has date data. I want the user to input a date of their choosing and then I want to create a new column that lists the difference in days between the two dates. The Macro that I have is working but I have a few questions and I would like to make it better. Link to MWE small data file is here. The user input date was 9/30/2013, which I stored in H20 Macro: Sub Date_play() Dim x As Date Dim x2 As Date Dim y As Variant x = InputBox(Prompt:="Please enter the Folder Report Date. The following formats are acceptable: 4 1 2013 or April 1 2013 or 4/1/2013") x2 = Range("E2") y = DateDiff("D", x2, x) MsgBox y 'Used DateDiff above and it works but I don't know how to use it to fill a column or indeed a cell. Range("H20").FormulaR1C1 = x Range("H1").FormulaR1C1 = "Diff" Range("H2").Formula = "=DATEDIF(E2,$H$20,""D"")" Range("H2").AutoFill Destination:=Range("H2:H17") Range("H2:H17").Select End Sub Now, could I have done this without storing the user input date in a particular cell? I would've preferred to use the variable "x" in the formula but it wasn't working for me. I had to store the user input in H20 and then use $H$20. What's the difference between the function Datedif and the procedure DateDiff? I am able to use the procedure DateDiff in my macro but I don't know how to use it to fill out my column. Is one method better than the other? Is there a better way to add columns to the existing sheet, where the columns include some calculations involving existing data on the sheet and some user inputs? There are tons of more complicated calculations I want to do next. Thanks

    Read the article

  • How do I subtract two dates in Django/Python?

    - by Ryan
    Hi! I'm working on a little fitness tracker in order to teach myself Django. I want to graph my weight over time, so I've decided to use the Python Google Charts Wrapper. Google charts require that you convert your date into a x coordinate. To do this I want to take the number of days in my dataset by subtracting the first weigh-in from the last weigh-in and then using that to figure out the x coords (for example, I could 100 by the result and increment the x coord by the resulting number for each y coord.) Anyway, I need to figure out how to subtract Django datetime objects from one another and so far, I am striking out on both google and here at the stack. I know PHP, but have never gotten a handle on OO programming, so please excuse my ignorance. Here is what my models look like: class Goal(models.Model): goal_weight = models.DecimalField("Goal Weight",max_digits=4, decimal_places=1) target_date = models.DateTimeField("Target Date to Reach Goal") set_date = models.DateTimeField("When did you set your goal?") comments = models.TextField(blank=True) def __unicode__(self): return unicode(self.goal_weight) class Weight(models.Model): """Weight at a given date and time """ goal = models.ForeignKey(Goal) weight = models.DecimalField("Current Weight",max_digits=4, decimal_places=1) weigh_date = models.DateTimeField("Date of Weigh-In") comments = models.TextField(blank=True) def __unicode__(self): return unicode(self.weight) def recorded_today(self): return self.date.date() == datetime.date.today() Any ideas on how to proceed in the view? Thanks so much!

    Read the article

  • Why does this Javascript work in FF3.6? new Date("2010-06-09T19:20:30+01:00");

    - by thegaw
    Here's the sample code: var d = new Date("2010-06-09T19:20:30+01:00"); document.write(d); On FF3.6 this will give you: Wed Jun 09 2010 14:20:30 GMT-0400 (EST) Other browers tested; Chrome 5, Safari 4, IE7 give: Invalid Date I know there is limited to no support for ISO8601 dates, but does anyone know what and/or where the difference is in FF3.6 that allows this to work? My thought is that FF is just stripping out what it doesn't understand while the others are not. Has anyone else seen this and/or getting different results from the test script?

    Read the article

  • Modulo operator in Objective-C returns the wrong result

    - by Greg Maletic
    I'm a little freaked out by the results I'm getting when I do modulo arithmetic in Objective-C. -1 % 3 is coming out to be -1, which isn't the right answer: according to my understanding, it should be 2. -2 % 3 is coming out to -2, which also isn't right: it should be 1. Is there another method I should be using besides the % operator to get the correct result?

    Read the article

  • Using Int32 or what you need

    - by Sir Psycho
    Should you use Int32 in places where you know the value is not going to be higher than 32,767? I'd like to keep memory down, hoever, using casts everywhere just to perform simple arithmetic is getting annoying. short a = 1; short result = a + 1; // Error short result = (short)(a + 1); // works but looks ugly when does lots of times What would be better for overall application performance?

    Read the article

  • Jquery datepicker popup not closing on select date in IE8

    - by Notorious2tall
    I've got a web form with a start date field. I've tied a jquery datepicker to the txt field. Now when I choose a date in FF, the selected date is populated in the text box and the calendar popup closes. However when I do the same thing in IE8, the selected date is populated in the text box but the popup remains open. I've also noticed that a script error is generated as soon as I select a date in the popup calendar. I'm using jquery 1.3.2, jquery-ui 1.7.2, and .NET 3.5. Here's an example of my code: <script type="text/javascript"> $(document).ready(function() { $("#<%=txtStartDate.ClientID%>").datepicker({ changeMonth: true, changeYear: true, showButtonPanel: true, showOn: 'button', buttonImage: '/_layouts/images/CALENDAR.GIF', buttonImageOnly: true }); }); </script> <div id="stylized"> <asp:ValidationSummary ID="vs" runat="server" CssClass="messages-error" HeaderText=" Action required before the form can be submitted." ForeColor="" ValidationGroup="sh" /> <div class="formrow"> <div class="ms-formlabel formlabel"> <asp:Label ID="lblStartDate" runat="server" CssClass="ms-standardheader" AssociatedControlID="txtStartDate">Start Date:</asp:Label> </div> <div class="ms-formbody formfield"> <asp:RequiredFieldValidator ID="reqStartDate" runat="server" ControlToValidate="txtStartDate" ErrorMessage="Start Date is a required field." Text="*" Display="Dynamic" ValidationGroup="sh"></asp:RequiredFieldValidator> <asp:CompareValidator ID="cvStartDate" runat="server" ControlToValidate="txtStartDate" ErrorMessage="Date must be in the format MM/DD/YYYY" Text="*" Display="Dynamic" ValidationGroup="sh" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator> <asp:TextBox ID="txtStartDate" runat="server"></asp:TextBox> <span class="formMessage">ex. MM/DD/YYYY</span> </div> </div> <div id="buttonrow"> <asp:Button ID="btnSubmit" runat="server" Text="Submit" CssClass="ms-ButtonHeightWidth" OnClick="Submit_Click" ValidationGroup="sh" /> <asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="ms-ButtonHeightWidth" OnClick="Cancel_Click" CausesValidation="false" /> </div> </div> Here's the script error I get in IE when I select the date: 'length' is null or not an object WebResource.axd Here's the code where the error is being thrown from: function ValidatorOnChange(event) { if (!event) { event = window.event; } Page_InvalidControlToBeFocused = null; var targetedControl; if ((typeof(event.srcElement) != "undefined") && (event.srcElement != null)) { targetedControl = event.srcElement; } else { targetedControl = event.target; } var vals; if (typeof(targetedControl.Validators) != "undefined") { vals = targetedControl.Validators; } else { if (targetedControl.tagName.toLowerCase() == "label") { targetedControl = document.getElementById(targetedControl.htmlFor); vals = targetedControl.Validators; } } var i; for (i = 0; i < vals.length; i++) { ValidatorValidate(vals[i], null, event); } ValidatorUpdateIsValid(); } It happens on the .length in the for loop at the end. Vals is null and isn't found in the previous if/else. I've stepped through the javascript and if (typeof(targetedControl.Validators) != "undefined") returns false and then if (targetedControl.tagName.toLowerCase() == "label") returns false too. Thus the length is null or not an object error. Now I'm not sure if the datepicker popup not closing in IE and the script error in the WebResources.axd file are related errors, but I'm leaning that way. Can anyone tell me why the popup isn't closing?

    Read the article

  • PHP: Strange Date Problem

    - by Me-and-Coding
    Hi, I have two users in my database whose birth date is set to: 1985-01-26 And then i have function which when provided the users' date, tells how many days are left in the birthday. Here is the function: function retage($iy,$im,$id) { if(!empty($iy)>0 && intval($im)>0 && intval($id)>0) { $tdo=$iy.'-'.$im.'-'.$id; $tdc=date('Y').'-'.$im.'-'.$id; /*echo "<br/>";*/ $cd=date('Y-n-j'); /*echo "<br/>";*/ if(strtotime($tdc)>strtotime($cd))//coming { $ty=floor((strtotime($tdc)-strtotime($tdo))/(3600*24*365)); $td=floor((strtotime($tdc)-strtotime($cd))/(24*3600)); if($td==1) { $td=round((strtotime($tdc)-strtotime($cd))/(24*3600)).' day to go'; } else { $td=round((strtotime($tdc)-strtotime($cd))/(24*3600)).' days to go'; } $ty='<font color="#C7C5C5">is turning '.$ty.' on <br>'.date('M jS Y',strtotime($tdc)).'</font>'; //return 'is turning '.$ty.' on '.$tdc; } elseif(strtotime($tdc)<strtotime($cd))//past { $ty=floor((strtotime($tdc)-strtotime($tdo))/(3600*24*365)); if($ty>0) { //$td='gone '.floor((strtotime($cd)-strtotime($tdc))/(24*3600)).' days ago'; $ndays=floor((strtotime($cd)-strtotime($tdc))/(24*3600)); if($ndays==1) $td=' gone '.round((strtotime($cd)-strtotime($tdc))/(24*3600)).' day ago'; else $td=' gone '.round((strtotime($cd)-strtotime($tdc))/(24*3600)).' days ago'; $ty='<font color="#C7C5C5">had turned '.$ty.' on <br>'.date('M jS Y',strtotime($tdc)).'</font>'; //return 'had turned '.$ty.' on '.$tdc; } else { $tdc=(date('Y')+1).'-'.$im.'-'.$id; $ty=floor((strtotime($tdc)-strtotime($tdo))/(3600*24*365)); //$td=floor((strtotime($tdc)-strtotime($cd))/(24*3600)).' days to go'; $td=floor((strtotime($tdc)-strtotime($cd))/(24*3600)); if($td==1) { $td=round((strtotime($tdc)-strtotime($cd))/(24*3600)).' day to go'; } else { $td=round((strtotime($tdc)-strtotime($cd))/(24*3600)).' days to go'; } $ty='<font color="#C7C5C5">is turning '.$ty.' on <br>'.date('M jS Y',strtotime($tdc)).'</font>'; //return 'is turning '.$ty.' on '.$tdc; } } else//today { $ty=floor((strtotime($tdc)-strtotime($tdo))/(3600*24*365)); if($ty>0) { $td='today'; $ty='<font color="#C7C5C5">has turned <br>'.$ty.' on today </font>'; //return 'has turned '.$ty.' on today'; } else { $ty='<font color="#C7C5C5">today</font>';$td=''; //return ''; } } } else { $ty='';$td=''; //return ''; } $ta[0]=$ty; $ta[1]=$td ; return $ta; } I use below code to show the days remaining: while($rs=mysql_fetch_array($result)) { if (isset($rs['byear'],$rs['bmonth'],$rs['bdate'])) { $tmptxt = retage($rs['byear'],$rs['bmonth'],$rs['bdate']); echo $tmptxt[1]; } } The strange thing is that for one user, the days remaining is shown correctly eg: gone 120 days ago And for other user having same birth date, this is shown: Jan 1st 1970 -14755 days to go Strange: When I use the same function outside of the loop and test with date 1985-01-26, the correct result is shown. Note: You can check out the function for yourself. Could you please tell what could be wrong there, your help will be highly appreciated. Thanks.

    Read the article

  • Keep Oracle VM 3 Up to Date

    - by Honglin Su
    More and more customers turn to Oracle VM 3 to virtualize their enterprise applications. Oracle VM support subscription is an integrated part of their successes. Customers enjoy the benefit of the industry-leading global support 24x7 for their server virtualization implementation, and receive access to patches, fixes, and updates via Unbreakable Linux Network (ULN). For customers running Oracle systems, Oracle VM support is included in Oracle Premium Support for Systems at no extra cost, and customers receive comprehensive systems coverage that includes single point accountability for Oracle server and storage hardware; integrated software (for example, firmware); and operating system software (Oracle Solaris, Oracle Linux, and Oracle VM). To run a successful virtualization infrastructure, it's important to keep Oracle VM 3 environment up to date by leveraging Oracle VM support resources.  Oracle VM Server Updates: You can easily upgrade Oracle VM Server using a Yum repository. You can download the latest server patch updates from ULN. To receive notification on the software update delivered to Oracle ULN for Oracle VM, you can sign up here. For information on setting up an Oracle VM Server Yum repository and using Oracle VM Manager to perform the upgrade of Oracle VM Servers, see Updating and Upgrading Oracle VM Servers in the Oracle VM User's Guide .  Oracle VM Manager Updates: Get the download instructions at OTN, and apply latest Oracle VM Manager patch. Be sure to review the patch README before you apply the patches. Support customers have access to extremely valuable knowledge notes from My Oracle Support. They are the first to receive useful tips to help address issues in Oracle VM deployments. For example, Upgrade to Oracle VM 3.1.1 using Yum Repository may cause network configuration scripts to be renamed causing network failure after reboot (Doc ID 1464126.1) Oracle VM server reboots after network becomes unresponsive due to deep C-State power management setting (Doc ID 1440197.1) For more information about Oracle's virtualization, visit oracle.com/virtualization.

    Read the article

  • Converting a JD Edwards Date to a System.DateTime

    - by Christopher House
    I'm working on moving some data from JD Edwards to a SQL Server database using SSIS and needed to deal with the way in which JDE stores dates.  The format is CYYDDD, where: C = century, 1 for >= 2000 and 0 for < 2000 YY = the last two digits of the year DDD = the number of the day.  Jan 1 = 1, Dec. 31 = 365 (or 366 in a leap year) The .Net base class library has lots of good support for handling dates, but nothing as specific as the JD Edwards format, so I needed to write a bit of code to translate the JDE format to System.DateTime.  The function is below: public static DateTime FromJdeDate(double jdeDate) {   DateTime convertedDate = DateTime.MinValue;   if (jdeDate >= 30001 && jdeDate <= 200000)   {     short yearValue = (short)(jdeDate / 1000d + 1900d);     short dayValue = (short)((jdeDate % 1000) - 1);     convertedDate = DateTime.Parse("01/01/" + yearValue.ToString()).AddDays(dayValue);   }   else   {     throw new ArgumentException("The value provided does not represent a valid JDE date", "jdeDate");   }   return convertedDate; }  I'd love to take credit for this myself, but this is an adaptation of a TSQL UDF that I got from another consultant at the client site.

    Read the article

  • Keep your Root Authorities up to date

    - by John Breakwell
    Originally posted on: http://geekswithblogs.net/Plumbersmate/archive/2013/06/20/keep-your-root-authorities-up-to-date.aspxBy default, Windows will automatically update it’s internal list of trusted root authorities as long as the Update Root Certificates function is installed. This should be enabled by default and takes manual intervention to remove it. With this component enabled, the following happens: If you are presented with a certificate issued by an untrusted root authority, your computer will contact the Windows Update Web site to see if Microsoft has added the CA to its list of trusted authorities. If it has been added to the Microsoft list of trusted authorities, its certificate will automatically be added to your trusted certificate store. If the component is not installed and a certificate from an untrusted CA is encountered then the following text will be seen: This is an inconvenience for the person browsing the site as they need to click to continue. Applications, though, will be unable to proceed and will throw an exception. Example: ERROR_WINHTTP_SECURE_FAILURE 12175 (0x00002F8F) One or more errors were found in the Secure Sockets Layer (SSL) certificate sent by the server. If you look at the certificate’s properties, you can see the “Issued by:” value:   This must match a Trusted Root Certificate Authority in the current user’s certificate store.   So turn on automatic updating of trusted root authority certificates. For Windows Vista and above, this option is controlled through Group Policy. See the “To Turn Off the Update Root Certificates Feature by Using Group Policy” section of the following Technet article: Certificate Support and Resulting Internet Communication in Windows Vista If Windows Update is a blocked site then download and deploy the latest pack of root certificates from Microsoft: Update for Root Certificates For Windows XP [May 2013] (KB931125)   Failing that, find a machine that has the latest root certificates installed and export them from there: Open up the Certificates console. Right-click the required Trusted Root Certificate Authority certificate Choose Export from “All Tasks” to open up the Certificate Export Wizard Choose an export file format – DER should be fine Provide a file name and complete the export. Move the file to the machine that’s missing the certificate Right-click the file and choose “Install Certificate” to open up the Certificate Import Wizard Allow the wizard to automatically select the certificate store and complete the import On a side note, for troubleshooting certificate issues it can be helpful to clear the SSL state:

    Read the article

  • SQLAuthority News – Mark the Date: October 16, 2013 – Introducing NuoDB Blackbirds: THE Distributed Database

    - by Pinal Dave
    I am very excited to announce first on this blog about the release of NuoDB Blackbirds (NuoDB Release 2.0). NuoDB is my favorite application to work with data now a days. They are increasingly gaining market share as well as brining out new features with their every new release. I was very excited when I learned that NuoDB is releasing their flagship release of 2.0 on October 16, 2013. Interesting enough I will be in USA while this release happens and I will be watching it live during my day time. Even though if I had to stay up the entire night to just watch this release, I would do it. Here is the details of the announcements: Introducing NuoDB Blackbirds: THE Distributed Database Date: October 16, 2013 Time: 1:00 PM EDT Location: Online Registration Link What is the best DBMS architecture to handle today’s and tomorrow’s evolving needs? The days of shared disk are over. The times are “a-changin” and IT infrastructure has to change with them. Join NuoDB live for the introduction of our latest major product release, NuoDB Blackbirds, and take a look at why the NuoDB distributed database architecture is the only answer for customers like Fathom Voice, a leading provider of Voice Over IP (VoIP). NuoDB CEO, Barry Morris, welcomes Cameron Weeks, CEO of Fathom Voice to discuss how his company is using DBMS to break away from the pack and become the hottest player in VoIP. The webcast will include demonstrations of a single, logical database running in multiple geographies and a live Q&A. If due to any reason, you cannot watch it live, do not worry at all, just register at this Registration Link, as after the event you will get the link to watch the event on-demand. You can watch the launch event at any time if you have registered for the launch. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL Tagged: NuoDB

    Read the article

  • Save the Date: Oracle Partner Day Deutschland

    - by Alliances & Channels Redaktion
    SAVE THE DATE ORACLE PARTNER DAYS 12. November 2014 Campus Kronberg in Kronberg bei FRANKFURTDer deutsche FY15 Oracle Partner Day findet am Mittwoch, 12. November 2014, im Campus Kronberg in Kronberg bei Frankfurt statt. Bitte vermerken Sie den Termin schon heute in Ihrem Kalender!Die Oracle Partner Day Veranstaltung bringt Sie auf den aktuellen Stand, informiert Sie über die neuesten Oracle Strategien und Neuheiten rund um das Oracle Produktportfolio und dies im Anschluss an die Oracle OpenWorld Konferenz in San Francisco (28. September bis 2. Oktober 2014). Kompakte Informationen, die Sie sofort nutzen können.Der Oracle Partner Day Event halt, was er verspricht. Er ist das ideale Forum für Partner und Oracle Vertreter gleichermaßen, um sich gemeinsam zu engagieren, voneinander zu lernen, Wissen miteinander zu teilen und bietet eine Plattform für die Identifizierung neuer Geschäftsmöglichkeiten in der PartnerNetwork Community. Die Teilnahme am Partner Day Event ist für Sie als Oracle Partner kostenfrei. Weitere Informationen zur Veranstaltung sowie die vollständige Agenda wird in Kürze online verfügbar sein. Wenn Sie heute bereits Ihren Platz reservieren möchten oder Fragen haben, schicken Sie einfach eine kurze Email an [email protected] freuen uns auf Sie!Oracle Partner Day Team Germany

    Read the article

  • Save the Date: Oracle Partner Day Deutschland

    - by Alliances & Channels Redaktion
    SAVE THE DATE ORACLE PARTNER DAYS 12. November 2014 Campus Kronberg in Kronberg bei FRANKFURTDer deutsche FY15 Oracle Partner Day findet am Mittwoch, 12. November 2014, im Campus Kronberg in Kronberg bei Frankfurt statt. Bitte vermerken Sie den Termin schon heute in Ihrem Kalender!Die Oracle Partner Day Veranstaltung bringt Sie auf den aktuellen Stand, informiert Sie über die neuesten Oracle Strategien und Neuheiten rund um das Oracle Produktportfolio und dies im Anschluss an die Oracle OpenWorld Konferenz in San Francisco (28. September bis 2. Oktober 2014). Kompakte Informationen, die Sie sofort nutzen können.Der Oracle Partner Day Event halt, was er verspricht. Er ist das ideale Forum für Partner und Oracle Vertreter gleichermaßen, um sich gemeinsam zu engagieren, voneinander zu lernen, Wissen miteinander zu teilen und bietet eine Plattform für die Identifizierung neuer Geschäftsmöglichkeiten in der PartnerNetwork Community. Die Teilnahme am Partner Day Event ist für Sie als Oracle Partner kostenfrei. Weitere Informationen zur Veranstaltung sowie die vollständige Agenda wird in Kürze online verfügbar sein. Wenn Sie heute bereits Ihren Platz reservieren möchten oder Fragen haben, schicken Sie einfach eine kurze Email an [email protected] freuen uns auf Sie!Oracle Partner Day Team Germany

    Read the article

  • ignoring saturday and sunday

    - by bsandrabr
    I am pulling in all the records from my customer database(mysql) for the last ten days $offset1 =strtotime("-10 day"); $date3=date("Y-m-d",$offset1); SELECT * FROM customers WHERE date between '$date3' and '$date' AND customer.custid = '$custid' ORDER by date DESC I would like to leave out the dates falling on a saturday or sunday and would like to put this in my query rather than the php If you can help thanks

    Read the article

  • Whats wrong with DateTime object

    - by Ayaz Alavi
    Hi, Can anyone tell what is wrong with the code. $timezone = "Asia/Karachi"; $date = new DateTime($when_to_send, new DateTimeZone($timezone)); $date = $date->setTimezone(new DateTimeZone('GMT')); $when_to_send = $date->format('Y-m-d H:i:s'); error is: Call to a member function format() on a non-object

    Read the article

  • Delegates does not work properly

    - by Warrior
    I am new to iPhone development. I am converting the date to the desired format and set it to the delegate and get its value in the another view. The session restarts when I tried to get the value from delegate. If I set the original date and not the formatted date in the set delegate, then i able to get the value in the another view. If I also give any static string value, then also I am able to the static string value back. Only the formatted date which is string is set then the session restarts. If i print and check the value of the formatted date it prints the correct formatted date only.Please help me out.Here is my code for date conversion NSString *dateval=[[stories objectAtIndex: storyIndex] objectForKey:@"date"]; NSDateFormatter *inputFormatter = [[NSDateFormatter alloc] init]; [inputFormatter setDateFormat:@"EEE, MMM dd, yyyy"]; NSDate *inputDate = [inputFormatter dateFromString:dateval]; NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init]; [outputFormatter setDateFormat:@"MMMM dd"]; NSString *outputDate = [outputFormatter stringFromDate:inputDate]; AppDelegate *delegate=(AppDelegate *)[[UIApplication sharedApplication]delegate]; [delegate setCurrentDates:outputDate]; EDIT: This is displayed in console inside view did load [Session started at 2010-04-21 19:12:53 +0530.] GNU gdb 6.3.50-20050815 (Apple version gdb-967) (Tue Jul 14 02:11:58 UTC 2009) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-apple-darwin".sharedlibrary apply-load-rules all Attaching to process 4216. (gdb) In another view - (void)viewDidLoad { NSLog(@"inside view did load"); AppDelegate *delegate=(AppDelegate *)[[UIApplication sharedApplication]delegate]; NSString *titleValue=[delegate getCurrentDates]; self.navigationItem.title =titleValue ; } The get does not work properly.It works fine if i give any static string or the "dateval". Thanks.

    Read the article

  • Java GregorianCalendar What am I doing wrong? Wrong date?

    - by saturation
    Hello I have a problem with GregorianCalendar. What is wrong in there? How outcome is 2010/6/1 and not 2010/05/31? package test; import java.util.Calendar; import java.util.GregorianCalendar; public class Main { public static void main(String[] args) { Calendar cal = new GregorianCalendar(2010, 5, 31); System.out.println(cal.get(Calendar.YEAR) + "/" + cal.get(Calendar.MONTH) + "/" + cal.get(Calendar.DAY_OF_MONTH)); } }

    Read the article

  • In PHP how do a translate a date to numerical format not knowing the format of the string beforehand

    - by stormist
    Examples of the translations I need to do: $stringDate = "November 2009"; $output = "11/09"; $stringDate = "October 1 2010"; $output = "10/01/2010"; $stringDate = "January 2010"; $output = "01/10"; $stringDate = "January 9 2010"; $output = "01/09/2010"; Note that I do not know which format the $stringDate will be in and the lack of commas in the month day year set. Thanks for any help anyone might offer.

    Read the article

  • Rails Tutorial Error with gemspec for "rspec" "annotate" "spork" "ansicolor" [closed]

    - by Chris H
    I'm following the Rails Tutorial by Michael Hartl and I'm getting this error when I run. bundle exec rspec spec/requests/static_pages_spec.rb Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/annotate-2.4.1.beta1.gemspec]: invalid date format in specification: "2011-09-02 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/guard-rspec-0.5.5.gemspec]: invalid date format in specification: "2011-11-20 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/guard-spork-0.3.2.gemspec]: invalid date format in specification: "2011-11-18 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/spork-0.9.0.gemspec]: invalid date format in specification: "2012-01-22 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/term-ansicolor-1.0.7.gemspec]: invalid date format in specification: "2011-10-13 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/annotate-2.4.1.beta1.gemspec]: invalid date format in specification: "2011-09-02 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/guard-rspec-0.5.5.gemspec]: invalid date format in specification: "2011-11-20 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/guard-spork-0.3.2.gemspec]: invalid date format in specification: "2011-11-18 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/spork-0.9.0.gemspec]: invalid date format in specification: "2012-01-22 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/term-ansicolor-1.0.7.gemspec]: invalid date format in specification: "2011-10-13 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/annotate-2.4.1.beta1.gemspec]: invalid date format in specification: "2011-09-02 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/guard-rspec-0.5.5.gemspec]: invalid date format in specification: "2011-11-20 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/guard-spork-0.3.2.gemspec]: invalid date format in specification: "2011-11-18 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/spork-0.9.0.gemspec]: invalid date format in specification: "2012-01-22 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/term-ansicolor-1.0.7.gemspec]: invalid date format in specification: "2011-10-13 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/annotate-2.4.1.beta1.gemspec]: invalid date format in specification: "2011-09-02 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/guard-rspec-0.5.5.gemspec]: invalid date format in specification: "2011-11-20 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/guard-spork-0.3.2.gemspec]: invalid date format in specification: "2011-11-18 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/spork-0.9.0.gemspec]: invalid date format in specification: "2012-01-22 00:00:00.000000000Z" Invalid gemspec in [/Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/specifications/term-ansicolor-1.0.7.gemspec]: invalid date format in specification: "2011-10-13 00:00:00.000000000Z" /Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `load': cannot load such file -- /Users/chrishuang02/Desktop/rails_projects/first_app/spec/requests/spec/requests/static_pages_spec.rb (LoadError) from /Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `block in load_spec_files' from /Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `map' from /Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `load_spec_files' from /Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:22:in `run' from /Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:69:in `run' from /Users/chrishuang02/.rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:10:in `block in autorun'

    Read the article

  • convert string to date and write back into NSMutableArray

    - by padatronic
    I have a NSMutableArray I get by loading a plist into it. The date field comes in as a string and i want to change it into a nsdate. I can change an nsstring into an nsdate. My array is an array of objects like the one below; { Date = "1/1/2009" Description = "Have you ever looked at a badger and thought i wonder how far you could fire that out of a cannon? Well this talk is for you"; File = "http://www.badgerCannon.org.uk/mp3/070310pm.mp3"; Series = "The Badger planet"; Speaker = "Will Ferell"; Title = "Is it a bird, is it a plane? no its a badger"; } I loop through and pull out the date and convert it from a NSString to a NSDate. I try writing it back in using the code; [[self.MediaDataArray objectAtIndex:i] replaceObjectAtIndex:0 withObject:Date]; but it errors and i am pretty sure it is because i am not putting it back into the array in the same format, ie just as a date not as date = "date". But lets face it i don't really know! Am i barking up the wrong tree? Please help, i have got the coding equivalent of writters block, or alternatively am just being really stupid! thanks in advance

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >