Search Results

Search found 553 results on 23 pages for 'hh'.

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

  • How do I convert a TimeSpan to a formatted string?

    - by Michael Wheeler
    Exact Duplicate Timespan formatting First question here: I have two DateTime vars, beginTime and endTime. I have gotten the difference of them by doing the following: TimeSpan dateDifference = endTime.Subtract(beginTime); How can I now return a string of this in hh hrs, mm mins, ss secs format using C#. If the difference was 00:06:32.4458750 It should return this 00 hrs, 06 mins, 32 secs Thanks for the help

    Read the article

  • Regular Expression to validate a timestamp

    - by Mohit Nanda
    Hi, I need a regular expression to validate a timestamp of the format, using Javascript: YYYY/MM/DD HH:MI:SS I tried cooking up a few, but seems my regex skills fail to cover something or other. Please give me a reference or way to do it. P.S. : I mention regex, only as a suggestion. Im using Javascript and welcome any alternative.

    Read the article

  • Most idiomatic way to print a time difference in Java?

    - by Zombies
    I'm familiar with printing time difference in milliseconds: long time = System.currentTimeMillis(); //do something that takes some time... long completedIn = System.currentTimeMillis() - time(); But, is there a nice way print a complete time in a specified format (eg: HH:MM:SS) either using Apache Commons or even the dreaded platform API's Date/Time objects? In other words, what is the shortest, simplest, no nonsense way to write this in Java?

    Read the article

  • Time DataType in Sql Server 2005

    - by MadBoy
    I've created small database under SQL Server 2008. Now i wanted to move it to SQL Server 2005 and it doesn't work since it doesn't have Time datatype. What option do I have to store only time in SQL Server 2005. I've written small TimeSheet application which needs to write hours and minutes mostly in format like 05:30:00 (hh:mm:ss) but ss is optional.

    Read the article

  • C# - Regular Expression validating Date and Hour

    - by nettguy
    I receive Date and time from CSV file The received Date format is YYYMMDD (string) (there is no ":" ,"-","/" to separate Year month and date). The received time format is HH:MM (24 Hour clock). I have to validate both so that (example) (i) 000011990 could be invalidated for date (ii) 77:90 could be invalidated for time. The question is , Regular expression is the right candidate for do so (or) is there any other way to achieve it?

    Read the article

  • What's wrong with how I'm using NSDateFormatter?

    - by Thom Mahoney
    dateFormatter = [[NSDateFormatter alloc] init]; dateFormatter.locale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"] autorelease]; [dateFormatter setDateFormat:@"EEE, d MMM yyyy HH:mm:ss zzz"]; NSString dateString = @"Tue, 08 Jun 2010 17:00:00 EDT"; NSDate eventDate = [dateFormatter dateFromString:dateString]; In this case the eventDate object is nil. Can somebody clue me in? This code used to work.

    Read the article

  • XPath find element based on ancestor element

    - by martymcfly
    Hi, again I have Java AST which is created from public class Test { String o = new String("hh"); public void wrong1() { synchronized(o) { // huhu } } } I try to create a XPath query which finds the synchronized block in which the defined String variable o is used. As the definition is above it is an ancestor of the SynchronizedStatement, but I dont get it working //SynchronizedStatement[Expression/PrimaryExpression/PrimaryPrefix/Name[@Image=ancestor::ClassOrInterfaceBody[ClassOrInterfaceBodyDeclaration/FieldVariableDeclaratorId/@Image]]] I know that /SynchronizedStatement[Expression/PrimaryExpression/PrimaryPrefix/Name[@Image= is correct, my problem is how to address the ancestor ClassOrInterfaceBody part. Hope its clear what i mean ;-) Thanks

    Read the article

  • FACING ERROR WHILE CALLING AXIS2 WEB SERVICE ...

    - by darshanv
    Hello , I am new to axis ,I have created a web servcie with couple of methods using axis2 and deployed it on tomcat.And am calling that web service from my android program with the help of ksoap.But wen i call a method which doesn't take any parameter am gettin fine reply from web service which i can able to see on my screen,But wen i call anothr method which takes a string argument am getting namespace exception on server WEB SERVICE CODE IS ..... package Guru; public class DarshanSays { public String getMsg(String h) { return h+" ..the power of change is eVolution..."; } public String getEmpty(String d)throws Exception { return "empty string from tomcattttttttttt"; } } //AND program is String soap_action="http://Guru/getEmpty"; String method_nm="getEmpty"; String nmspc="http://Guru/"; String url7="//192.168.10.182:8080/axis2/services/Friday";//http: SoapObject request = new SoapObject(url7,method_nm); /*sending method parameters with SoapObject */ request.newInstance(); request.addProperty("h","darshan.....");//sending a parameter to a method SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.bodyOut=request; envelope.dotNet = true; envelope.encodingStyle = SoapSerializationEnvelope.XSD; Log.d("Step","3"); envelope.dotNet=true; /*setting outputsoap object sending request */ envelope.setOutputSoapObject(request); /*HttpTransportSE object creating sending it url */ androidHttpTransport = new HttpTransportSE(url7); //androidHttpTransport.setXmlVersionTag(""); Log.d("Step","4"); try{ androidHttpTransport.debug=true; androidHttpTransport.call(nmspc,envelope); } catch(Exception e) { Log.d("Transportcall",""+e); alert=new AlertDialog.Builder(this); alert.setMessage(""+e); alert.show(); } //exception is throw. Log.d("Step","5"); try { Log.d("giving...","resp"); SoapPrimitive sp=(SoapPrimitive)envelope.getResponse(); String hh=sp.toString(); Log.d("reply from web ser",".."+hh.toString()); //and erorr msg is SoapFault - faultcode:'soapenv:Server' faultstring: 'namespace mismatch require http://Guru found 192.168.10.182:8080/axis2/services/Friday' faultactor: 'null' detail: org.kxml2.kdom.Node@43d31390 ERROR IS coming only when am calling parameterized method. I am facing this issue only when am giving a call to parameterized method. Please Help.. thanks Darshan V

    Read the article

  • Checking the time in Objective-c?

    - by Moshe
    how can I get the current time in hh:mm format? I need to be able to tell between AM and PM and compare between the current time and a second time as well. I'm sure it's a silly function but i can't seem to figure it out.

    Read the article

  • Oracle get previous day records

    - by Phill Pafford
    Ok I think I'm getting the previous year instead of the previous day, but I need to previous day. SELECT TO_DATE(TO_CHAR(CURRENT_DATE, 'YYYY-MM-DD'),'YYYY-MM-DD') - 1 FROM Dual I'm comparing it to a datetime stamp in this format and wish to get all the rows from the previous day. YYYY-MM-DD HH:MM:SS So I'm trying something like this SELECT field,datetime_field FROM database WHERE datetime_field > TO_DATE(TO_CHAR(CURRENT_DATE, 'YYYY-MM-DD'),'YYYY-MM-DD') - 1

    Read the article

  • WCF .Net 4.0 is treating WebProtocolException as an unhandled exception

    - by Benjii
    Im trying to build an API using WCF and .Net 4, however when I throw the WebProtocolException, it is not displaying a nice error message like it should, instead it is treating it like an unhandled exception. I am using the WebServiceHost2Factory. Has anyone else used WebProtocolException with .net 4? An example of my call is below throw new WebProtocolException(System.Net.HttpStatusCode.BadRequest, "The DateFrom parameter is invalid", new Error() { Code = 6002, Message = "Please ensure your dates are in the following format: yyyy/MM/dd hh:mm:ss" }, null, null);

    Read the article

  • NSDateFormatter

    - by srushti
    my code is like this NSString *tempDate = [NSString stringWithString:tempReviewData.pubDate]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateStyle:NSDateFormatterLongStyle]; [dateFormatter setTimeStyle:NSDateFormatterNoStyle]; [dateFormatter setDateFormat:@"HH:mm a"]; NSDate *newDate = [dateFormatter dateFromString:tempReviewData.pubDate]; My newDate is getting nil at this point i dont know why

    Read the article

  • Cross field validation in jsf h:datatable using p:calendar

    - by Matt Broekhuis
    I noticed this question was asked, but it has not been answered correctly. I have a datatable that has two columns start date and end date. Both contain primefaces p:calendar controls in them. I need to ensure that for each row that the date in column1 is not after the date in column2. I would like to tie this into the JSF validation framework, but I'm having trouble. i've tried marking the datatable rowStatePreserved="true" , this allows me to get the values, but something is still wrong as when it fails, all the values in the first row overwrite all the other values. What am I doing wrong, or should I be using a completely different strategy? xhtml code <h:form> <f:event type="postValidate" listener="#{bean.doCrossFieldValidation}"/> <p:dataTable id="eventDaysTable" value="#{course.courseSchedules}" var="_eventDay" styleClass="compactDataTable" > <p:column id="eventDayStartColumn"> <f:facet name="header"> Start </f:facet> <p:calendar id="startDate" required="true" value="#{_eventDay.startTime}" pattern="MM/dd/yyyy hh:mm a"/> </p:column> <p:column id="eventDayEndColumn"> <f:facet name="header"> End </f:facet> <p:calendar id="endDate" required="true" value="#{_eventDay.endTime}" pattern="MM/dd/yyyy hh:mm a"/> </p:column> </p:dataTable> </h:form> validationCode public void doCrossFieldValidation(ComponentSystemEvent cse) { UIData eventsDaysStable = (UIData) cse.getComponent().findComponent("eventDaysTable"); if (null != eventsDaysStable && eventsDaysStable.isRendered()) { Iterator<UIComponent> startDateCalendarIterator = eventsDaysStable.findComponent("eventDayStartColumn").getChildren().iterator(); Iterator<UIComponent> endDateCalendarIterator = eventsDaysStable.findComponent("eventDayEndColumn").getChildren().iterator(); while (startDateCalendarIterator.hasNext() && endDateCalendarIterator.hasNext()) { org.primefaces.component.calendar.Calendar startDateComponent = (org.primefaces.component.calendar.Calendar) startDateCalendarIterator.next(); org.primefaces.component.calendar.Calendar endDateComponent = (org.primefaces.component.calendar.Calendar) endDateCalendarIterator.next(); Date startDate = (Date) startDateComponent.getValue(); Date endDate = (Date) endDateComponent.getValue(); if (null != startDate && null != endDate && startDate.after(endDate)) { eventScheduleChronologyOk = false; startDateComponent.setValid(false); endDateComponent.setValid(false); } } if (!eventScheduleChronologyOk) { showErrorMessage(ProductManagementMessage.PRODUCT_SCHEDULE_OUT_OF_ORDER); } } }

    Read the article

  • Issue with parsed text with HTMLCleaner - spaces at the begining of text

    - by ansol90
    Im able to get text using HTMLCleaner from website. The problem is that when I set the text to a TextView it shows the beginning of the text with a big space on it. Here is the screenshot of what im talking about. I have tried android:gravity but nothing happened. Please help. Here is my Code: private class SiteParser extends AsyncTask<String, Void, String> { protected String doInBackground(String... arg) { String output = null; try { HtmlHelper hh = new HtmlHelper(new URL(arg[0])); List<TagNode> news = hh.getnewsByClass("TextoPrint"); for (Iterator<TagNode> iterator = newss.iterator(); iterator .hasNext();) { TagNode divElement = (TagNode) iterator.next(); output = divElement.getText().toString(); } } catch (Exception e) { e.printStackTrace(); } return output; } protected void onPostExecute(String output) { Bundle bundle=new Bundle(); bundle.putString("body",output); Intent mainIntent = new Intent(act, MyView.class); mainIntent.putExtras(bundle); startActivity(mainIntent); act.finish(); } } public class HtmlHelper { TagNode rootNode; public HtmlHelper(URL htmlPage) throws IOException, XPatherException { HtmlCleaner cleaner = new HtmlCleaner(); rootNode = cleaner.clean(htmlPage); } List<TagNode> getnewsByClass(String Classname){ List<TagNode> newsList = new ArrayList<TagNode>(); TagNode divElements[] = rootNode.getElementsByName("div", true); for (int i = 0; divElements != null && i < divElements.length; i++) { String classType = divElements[i].getAttributeByName("id"); if (classType != null && classType.equals(Classname)) { newsList.add(divElements[i]); } } return newsList; } }

    Read the article

  • JavaScript/jQuery short hand function definitions

    - by Baddie
    I'm using a jQuery plugin that has its functions defined as such: $('#mydiv').pluginAction({ someproperty: val, format: 'mm hh', labels: ['yes', 'no', 'maybe'], labels1: ['never', 'always'] }); In my HTML page, I have multiple DIVs that have the same properties for format, labels, labels1, but different values for someproperty. Is there some type of JavaScript notation I can take advantage of to shorten the definition so that I don't have to have duplicate code?

    Read the article

  • SQL query in SQL SERVER 2005 - Comparing Dates

    - by YeomansLeo
    I'm having a hard time doing this query. I want to compare dates in my query, dates from my DB are in this format: (MM/DD/YYYY HH:MM:SS AM) I want to compare this date with tomorrow's day, today plus one. My questions are: How do I declare tomorrow's date in sql server? How would you compare these two dates? Thank you!! =D EDIT : DATES in DB are VarChar =S

    Read the article

  • reformat text in perl

    - by paul44
    I have a file of 1000 lines, each line in the format filename dd/mm/yyyy hh:mm:ss I want to convert it to read filename mmddhhmm.ss been attempting to do this in perl and awk - no success - would appreciate any help thanks

    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

  • Try catch finally blocks.. do i still need them?

    - by Phil
    I am handling errors via my global.asax in this method: Dim CurrentException As Exception CurrentException = Server.GetLastError() Dim LogFilePath As String = Server.MapPath("~/Error/" & DateTime.Now.ToString("dd-MM-yy.HH.mm") & ".txt") Dim sw As System.IO.StreamWriter = New System.IO.StreamWriter(LogFilePath) sw.WriteLine(DateTime.Now.ToString) sw.WriteLine(CurrentException.ToString()) sw.Close() In my code I currently have no other error handling. Should I still insert try, catch, finally blocks? Thanks.

    Read the article

  • Log4j show package name

    - by Stephane Grenier
    Right now for my ConversionPattern I have: log4j.appender.A1.layout.ConversionPattern=%d{yyyy MMM dd HH:mm:ss,SSS} %5p [%t] (%F:%L) - %m%n What I'd like to do is also include the full package name with the class (%F:%L) but I can't find any config to do so in the docs. I do understand that this will be slower, but it's only for debugging and not when the system will be in production.

    Read the article

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