Get the Current Date and Time of a Location

I have created a windowsPhoneApplication in silverLight 8.1.In my application,I have to upload videos on some server.The Uploading get failed If the Date and Time settings of my device is not the current Date and Time.So How can I get the current date
and time even if the device settings is wrong?

Hi shifana,
Do you know server's time zone? If yes, you can manually translate to the correct time zone.
Otherwise try some online time acquire API.
--James
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • How to get the current data and time of SCOM server via SCOM SDK (API) calls?

    Hi,
    I need to read the current date and time of SCOM server via SOM SDK.
    Is there a class in SDK that provides this info ?
    Thanks,
    satheesh

    To get time and date of Alerts of SCOM, You can use following command let "get-scomalert"
    Also, You can refer below links
    http://blog.tyang.org/2013/02/21/using-scom-2012-sdk-to-retrieve-resource-pools-information/
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"
    Mai Ali | My blog: Technical

  • Put the current date and time in a string

    I am having trouble trying to put the current date and time from my Calendar object into a string
    any ideas?

    Calendar timeCal = Calendar.getInstance();
    timeCal.setTime(new Date(System.currentTimeMillis() - startTime ));
    String date = formatToTwoDigits(timeCal.get(Calendar.HOUR_OF_DAY))     + ":" +
    formatToTwoDigits(timeCal.get(Calendar.MINUTE))          + ":" +
    formatToTwoDigits(timeCal.get(Calendar.SECOND));
    private String formatToTwoDigits(int i) {
    String ret = null;
    i = i % 100;
    if (i < 10) {
    ret = "0" + Integer.toString(i);
    } else {
    ret = Integer.toString(i);
    return ret;
    You can figure out yourselve how to display the date, use other Calendar.XXX properties.
    Good luck!

  • How to get the client date and time ?

    Dear Sirs...
    Using jdeveloper 10.1.2.0
    How can i get the client date and time using the HttpServletRequest ?
    thanks for any help in advance
    best regards

    If your code is running on the client pc you can just create a new instance of the java.util.Date class. That class automatically defaults to the current time of the client machine. Otherwise if you're running the code on the server, you could insert/post the client date/time by adding its string representation as a parameter to the HTTP request object.
    Ronald

  • I'm trying to display the current date and time on my iPad.

    First, I'm not sure this is a valid post to this forum.  If not, I'd appreciate knowg in where I can get help. 
    I have tried several ways to display the current date and time on my iPad.  None  work.  Most things I try give me complier errors but the latest code compiles but won't display the correct time. 
    Here's the dispatch code in my ViewController.m file:
    dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
        dispatch_async(queue, ^{
            [NSTimer scheduledTimerWithTimeInterval:NSTimeInterval)1.0f target:self selector:@selector(updateLabel:) userInfo:nil repeats:YES];
    Here's the updateLabel code: (which never gets executed).
    - (void)updateLabel:(id) sender {
        dispatch_sync(dispatch_get_main_queue(), ^{
        NSLog(@"Datefield Update Called");
        NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
        [dateFormatter setDateFormat:@"EEEE, MMMM dd, yyyy 'at' HH:mm  ZZZZ"];
        NSDate *dayTime = [NSDate date];
        NSString *formattedDateString = [dateFormatter stringFromDate:dayTime];
            _dateField.text = formattedDateString;
        [self.view addSubview:_dateField];
        NSLog(@"Datefield %@",_dateField.text);

    Your code is needlessly complicated and has a few problems:
    // These objects should be created only once.
    NSTimer *dateAndTimeTimer; (You might need to make this a property with a strong reference).
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
    [dateFormatter setDateFormat:@"EEEE, MMMMM dd, yyyy 'at' HH:mm ZZZZ"];
    // The subview should only be added once.
    [self.view addSubview:_dateField];
    [self performSelectorOnMainThread:@selector(startDateAndTimeTimer)
                            withObject:nil
                         waitUntilDone:YES];
    -(void)startDateAndTimeTimer
        NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:1
                                                          target:self
                                                        selector:@selector(updateLabel)
                                                        userInfo:nil
                                                         repeats:YES];
        dateAndTimeTimer = timer;
        [[NSRunLoop mainRunLoop] addTimer:dateAndTimeTimer forMode:NSRunLoopCommonModes];
    -(void)updateLabel
         NSDate *dateTime = [NSDate date];
         NSString *formattedDataString = [dateFormatter stringFromDate:dateTime];
         _dateField.text = formattedDateString;
         NSLog(@"_dateField.text=%@", _dateField.text);

  • How to display the current Date and time in xslt version 1

    i am using xslt version 1 .i want to display the current date and time in the output xml using xslt(Jdeveloper) ..i just added the namespace xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
         xmlns:ns1="urn:oracle:integration:b2b:7D30046DC68A4FA689956D8241FA3B99">
    and used thsi function <xsl:value-of select = "xp20:current-date()"/>
    but it does not works for me ..help needed????
    Edited by: user9519185 on Jan 20, 2009 3:04 AM

    Use a formula: =NOW()
    Format the cell for Date and Time, with both the Date part and the Time part displayed. Format the two parts as you wish, using the choices in the Inspector's menus.
    The cell will update each time the table is recalculated.
    (Description is for Numbers '09 (Mac), Numbers for iOS will be similar, but not necessarly identical in details.)
    Regards,
    Barry

  • I Need to Write the current Date and Time

    I need to write the current date and time to calculate the spend time in each instruction.
    What is the instrucion?
    Thanks.
    MIGUEL ANGEL CARO
    [email protected]

    The current time can be determined with a Date object:
    Date now = new java.util.Date() ;or if you are interested in the seconds since the epoch:
    System.currentTimeMillis() ;If you wanted to print them out:
    System.out.println( new java.util.Date() ) ;
    System.out.println( System.currentTimeMillis() ) ;Kenny

  • Wrote the current Date and Time in the backend

    HI everyone,
    I created a table view, where I display several records. Right now I will add an record to this table, which should be written back in the backend and automaticaly add the current date and time.
    But I don´t know to make this. I tried several time with the funktion  "now()", but it doesn´t work. So any help for me, to explain how I can display the actual time and then write it back to the backend?
    Thanks

    we use a crm system. but the BAPI I mentioned was
    just to play with. My basis will develop a new API
    for the project, that have the requested Inputfields.
    But what I tottaly forget was, that there has to be a
    field for the time, so thanks for the advice.
    No Problem.
    I´m still of the opinion , that it should be possible
    to add the curret time in a field with the
    funcionality of the VC, even there is a way to show a
    clock with the current time. My problem is that I
    can´t figuer out how to do this.
    Therefore you can use the TNow() function (Time functions) and the Now() Function (Date functions). You can cast them to a string and concatenate the string, then you have the date of today with the current time. This string you can format and transfer it as input for your BAPI_ADD_BP for example.
    Hope that helps.
    Best Regards,
    Marcel

  • How to get the current date and compare dates

    hi
    does anyone know how you would get the current date?
    furthermore, how to compare the current date with a past date to see how many days or months have past since then?
    thanks

    have a look at the Date class. new Date() creates an object containing the exact date and time at creation time. (Date).getTime() might be useful for comparing two dates. GregorianCalendar might be useful, too.

  • Sample XSLT code to Display the Current date and time

    Hi all,
    Please Let me know code to display the system date in my target in xslt mapping.
    I am trying fn:current-datetime() function for the same.but could not get how to use it .Is it  function right  function.If so please send me the examples on the same.
    Thanks and Regards,
    Srini

    hey
    use this date:date-time()
    also have a look at this
    http://www.w3.org/TR/xpath-functions/#func-current-dateTime
    thanx
    ahmad

  • How to print the current date and time?

    Hi Friends!
    I have tried this program to print the current time and date,
    #include <iostream>
    #include <time.h>
    using namespace std;
    int main()
    time_t tim;
    time(&tim);
    cout << ctime(&tim);
    return 0;
    But it show the warning as;
    warning C4996: 'ctime': This function or variable may be unsafe. Consider using ctime_s instead.
    Can anyone suggest whats wrong with this?

    i also got many warring when i use old version keyword. as i note on think thatin new vc++ has many keyword change with _s. the old keyword works even get warring.or you can change to as it suggest.For About ctime_s
    Check this link for more detail (RefLink)
    No, it shows error, when you use ctime_s instead of ctime.
    error C2660: 'ctime_s' : function does not take 1 arguments

  • How to get the system date and time using java

    hi,
    I want system date in my out put. how to access system date. can v use utill packaegs (or) sql. which one is the best to get.
    Thanks & Regards,
    Kenny.

    import java.util.Date;
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    public class MyClass {
    public void setTimeStamp() {
    int hour, minute, second, time = 0;
    Date dt=new Date();
    System.out.println(dt.getDate());
    System.out.println(dt.getMonth());
    System.out.println(dt.getYear());
    Calendar cal = new GregorianCalendar();
    hour = cal.get(Calendar.HOUR_OF_DAY);
    minute = cal.get(Calendar.MINUTE);
    second = + cal.get(Calendar.SECOND);
    System.out.println (hour + ":" + minute + ":" + second);
    public static void main (String args[]){
    MyClass app = new MyClass();
    app.setTimeStamp();
    }

  • Insert current date and time into Oracle date type field

    I have a JDBC current date and time insert into Oracle 9i that almost works. It submits the current date and a fixed time into the Oracle date type field. I am using Tomcat 6.0.20.
    For example if I insert the data at 7:24:04 PM on Feb 16, 2010 it will insert as: 16-Feb-2010 12:00:00 AM
    The date part works but the time always shows 12:00:00 AM no matter what date or time the data is inserted.
    Here is what I have for my JDBC inserts and I also tried something with DateFormat:
    PreparedStatement ps; Date mydate = new Date(new java.util.Date().getTime()); //insert statement here.... stmt.setDate(1,mydate);
    I also tried:
    PreparedStatement ps; java.sql.Timestamp mydate = new java.sql.Timestamp(new java.util.Date().getTime()); SimpleDateFormat fmt = new SimpleDateFormat(.... //insert statement here.... ps.setTimestamp(1,fmt.format(mydate));
    Both keep submitting the date into Oracle as 16-Feb-2010 12:00:00 AM
    Anyway to get the current date and time? For example if I insert the data at 7:24.04 pm today it should show as 16-Feb-2010 07:24.04 PM in Oracle.

    sportsMarkr wrote:
    Date mydate = new Date(new java.util.Date().getTime());Please see the javadocs for java.sql.Date and note the part that says "...to zero"
    [http://java.sun.com/javase/6/docs/api/java/sql/Date.html]
    If you want a date and time then use java.sql.Timestamp.

  • GregorianCalendar - getting the current date

    Hi,
    Have any of the Calendar classes been changed in version 1.5. I'm trying to get the current date and time in an application, to add to filenames when they are backed up. In java 1.4 the following code was sufficient to get the information required:
    GregorianCalendar cal = new GregorianCalendar();
    filename = "C:\\Program Files\\Apache Group\\Apache2\\www\\test\\htdocs\\backups\\";
    filename += theFile;
    filename += "=" + getUser() + "=" + cal.get( Calendar.HOUR_OF_DAY ) + "_" +
         cal.get( Calendar.MINUTE ) + "=" + cal.get( Calendar.DAY_OF_MONTH ) + "_" +
         ( cal.get( Calendar.MONTH ) + 1 ) + "_" + cal.get( Calendar.YEAR );
    I'm writing another app using the same code and SDK 1.5, but it's returning the same values every time.
    Cheers
    Matt

    I wrote a small program to test the Calendar object on my system:
    import java.util.*;
    import java.awt.event.*;
    import java.awt.*;
    public class Tester extends Frame implements ActionListener
         public Tester()
              javax.swing.Timer timer = new javax.swing.Timer( 1000, this );
              timer.start();
              setSize( 400, 400 );
              show();
              addWindowListener(
                   new WindowAdapter()
                        public void windowClosing( WindowEvent e )
                             System.exit( 0 );
         public void actionPerformed( ActionEvent e )
              Calendar cal = new GregorianCalendar();
              System.out.println( "Time: " + cal.HOUR + ":" + cal.MINUTE + ":" + cal.SECOND );
         public static void main( String args[] )
              Tester t = new Tester();
    This repeatedly outputs:
    10:12:13
    I tried this with Calendar and GregorianCalendar. Both of them do not seem to work. I'm not using the same Calendar object, or outputing in the same second....

  • Need to display current date and time in arabic

    Hi,
    I'm very new to arabic and probable this is sumthing simple.
    I have to work on a flash arabic application.
    Through actionscript 2 I'm getting the current date and time.
    I want to display this in arabic. Please suggest me a solution.
    Thanks
    Sunira

    You would have to work out some font or something. I have no experience with Arabic

Maybe you are looking for

  • A special scenario for purchasing....

    Dear Friends,   I am working on a particular scenario, but unable to solve. Please guide me on solving it.    A sales order is raised for a particular material, since the material is not available a purchase requisition is generated. Now with respect

  • HELP  Regarding Problem Found during transportation

    Hi Experts I was transported my request from DEV  to PROD When i am Importing my Objects in Producton server System is throwing this Error. --Start of the after-import method for object type R3TR UPDR (Activation Mode) Info object VV00B is not availa

  • Non-standard aspect ratio

    Currently, I am using iMovie '09 (version 8.0.6) and iMovie HD 6.0.4. With both programs, I failed to import a quicktime movie that has aspect ratio 0.83 (1030:1240) without getting a distorted output. (I did read the help and I also googled a lot, t

  • Print Color Management Problem ?

    I have a print color management problem I cannot solve. It reminds me of the print color management problem I had over a year ago when the compatibility conflict between LR and MAC Leopard produced horrible prints. I have Snow Leopard now and been ou

  • CIN With-holding Tax Table

    Dear Sir, I seek the kind help from the experts  as , whic is the table to give the following information related to CIN With-holding Tax : Information is : Certificate Number / Challan Number / Challan Date With Thanks and Regards B Mittal