How to get system time and date with PHP

Dear Mr.Craig,
  Thanx a lot. We are running SRM 5.0 (RAMP - Implementation).
  My initial requirement is to write a server-side script to display server date and time. Could you give more inside on how to achieve it?
Regards,
Deva.

Perhaps that will help.
[code]
<html>
<h1>Access System time and date</h1>
<?
     // saprfc-class-library     
     require_once("saprfc.php");
     $sap = new saprfc(array(
   "logindata"=>array(
   "ASHOST"=>"localhost"          // application server
   ,"SYSNR"=>"00"                    // system number
      ,"CLIENT"=>"000"               // client
      ,"USER"=>"bcuser"               // user
      ,"PASSWD"=>"minisap"          // password
     ,"show_errors"=>false               // let class printout errors
     ,"debug"=>false)) ;                     // detailed debugging information
     $result=$sap->callFunction("MSS_GET_SY_DATE_TIME",
        array(     array("EXPORT","SAPTIME",array()),
           array("EXPORT","SAPDATE",array())));
     if ($sap->getStatus() == SAPRFC_OK) {
    echo "Time: ".$result["SAPTIME"];
    echo "<br>Date: ".$result["SAPDATE"];
    echo "<br>or<br>";
    echo "Server is showing: "
         .substr($result["SAPDATE"], 0, 4)
         ."-".substr($result["SAPDATE"], 4, 2)
         ."-".substr($result["SAPDATE"], 6, 2)
         ." and "
         .substr($result["SAPTIME"], 0, 2)
         .":".substr($result["SAPTIME"], 2, 2)
         .":".substr($result["SAPTIME"], 4, 2);
     } else {
          $sap->printStatus();
     $sap->logoff();
?>
[/code]

Similar Messages

  • How to get System Time and Date?

    Hi, may i know how do i get the System's current Time and Date?? And i need to format them into 2 separate String, that's Time is a String, Date is another String. Pls guide me. Thanks a lot!

    What's the problem? The previous example was pretty clear. Just adapt it to your purposes...
            Date currentDateAndTime = new Date();
            SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
            SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
            System.out.println(dateFormat.format(currentDateAndTime));
            System.out.println(timeFormat.format(currentDateAndTime));

  • How to get current time and date??

    How to get current time and date from my PC time and date to the java application??
    i use java.util.* package but got error, that is:
    - java.util.* and java.sql.* class are match
    - abstract class cannot be instantiated
    so what can i do, pls guide...thanks...

    There is a method in the System class that will return the current system time. You could also instantiate a Date, Time, Timestamp, or Calendar object, all of which get created with the system time by default.
    Don't import *. Import the specific classes you need.
    Next time, post the actual text of the exceptions/compile errors. If you make people guess, most just won't bother.

  • How can we get Dynamic columns and data with RTF Templates in BI Publisher

    How can we get Dynamic columns and data with RTf Templates.
    My requirement is :
    create table xxinv_item_pei_taginfo(item_id number,
    Organization_id number,
    item varchar2(4000),
    record_type varchar2(4000),
    record_value CLOB,
    State varchar2(4000));
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'USES','fever','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'HOW TO USE','one tablet daily','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'SIDE EFFECTS','XYZ','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'DRUG INTERACTION','ABC','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'OVERDOSE','Go and see doctor','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'NOTES','Take after meal','TX');
    select * from xxinv_item_pei_taginfo;
    Item id Org Id Item Record_type Record_value State
    493991     224     1265-D30     USES     fever     TX
    493991     224     1265-D30     HOW TO USE     one tablet daily     TX
    493991     224     1265-D30     SIDE EFFECTS     XYZ     TX
    493991     224     1265-D30     DRUG INTERACTION     ABC     TX
    493991     224     1265-D30     OVERDOSE      Go and see doctor     TX
    493991     224     1265-D30     NOTES     Take after meal     TX
    Above is my data
    I have to fetch the record_type from a lookup where I can have any of the record type, sometime USES, HOW TO USE, SIDE EFFECTS and sometimes some other set of record types
    In my report I have to get these record typpes as field name dynamically whichever is available in that lookup and record values against them.
    its a BI Publisher report.
    please suggest

    if you have data in db then you can create xml with needed structure
    and so you can create bip report
    do you have errors or .... ?

  • Compare current time and date with last modified?

    Compare current time and date with last modified?
    What is the ideal way to compared the last modified from the File class with the current date and time? last modifed value from File class is a long.

    798642 wrote:
    So what do I do to compare whether the current date and time and later than the lastModified ?
    if(file.lastModified() < System.currentTimeMillis()) {
    Like that?That tests whether the last modified time is before "now"--that is if the file was not modified in the future, so, yes.

  • Update time and date with server time..?

    Hi.. All
    every login ,flash get server time from php. how can i update  time and date in flash..?

    I'm going to only show the month example, the rest is fairly straightforward:
    <?php $month = date('n'); ?>
    var date:Date = new Date();
    trace(date);
    date.setMonth($month);
    trace(date);

  • Error when giving untill condition for System time and date

    Hi Experts,
    i am using Untill Loop in my workflow to set condition for System time and date.According to this condition when system date and time is greater than equal to some date and time then mail goes to an agent.But during testing , the workflow gets into error stage.
                 In workflow log i am getting error like
    'Maximum number of    10000 nodes reached' in executed action 'DEQUEUE_NEXT_NODE'  for false condition.
                        Please suggest what may be possible cause or solution for it?
               Points will be rewarded for any good solution.
    Thanks
    Snehasish Das

    Hi,
    You should not use loop for that kind of purpose. It sounds to me that your workflow is looping all  the time, and the maximum numer of nodes is reached soon, and the workflow goes into error.
    You should use the WF deadline functionality for your purpose. For example use in a relevant step the "latest end" tab, and define the deadline there. Then when your deadline is reached, the workflow will continue in a separate outcome, and there you can send your mail.
    Regards,
    Karri

  • How do i reset time and date on my itouch

    how do I reset time and date on my itouch?

    Go to Settings>General>International and make sure that Calendar is set to Gregorian.
    Bext
    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up                             
    - Restore to factory settings/new iOS device.
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar          

  • How to get system status and user status ?

    how to get system status and user status for the given production order?
    In which PP table we can
    find these?
    Thanks&Regards
    Satish

    Hi Ram,
    Use the FM "STATUS_READ" to read both the system and user statuses for an Order.
    Alternatively, the following tables store the user and system status info:
    JSTO- Status object information
    JEST- Individual Object Status
    Hope this helps.
    Let me know if u need further information.
    Regards,
    Sonal

  • How to show two different plots with current system time and date on waveform chart

    I am using  one waveform chart to display the more than one value continiously. The data  are comming properly but i am not getting my system (pc) time and date on x axis. It is showing default date and time (i.e.01/01/1904 5:30:45). Please  give me suggestions to display the real time and date on x axis of waveform chart. 

    How does your data look like? Do you graph waveform data types, dynamic data, or plain arrays/clustes? In the case of plain arrays, you need to set x0 to the absolute start time of your data, e.g. with a property node.
    I you would attach your code (or an image) we could offer more specific advice. There are too many possibilities.
    LabVIEW Champion . Do more with less code and in less time .

  • UC320: how to set (correct) time and date, upload own AA messages, get caller ID, telnet?

    Hello there,
    Just trying out the UC320 I got borrowed from Cisco AT for testing with firmware 2.1.2 (1) localized for Austria.
    The device is connected to the cable modem of my ISP (Kabelsignal) utilizing two FXO ports, getting an IP address from my DHCP being connected to a WS-C2960G-24TD (LAN 1@UC320 connected to Gi0/18@C2960G port macro Cisco Switch enabled).
    Now I would like to try/see the following features:
    - a correct time and date: huh? hwo/where???
    No option to set this right??? No NTP option??? Am I just blind or too stupid to find that option/s?
    - upload own messages for the AA: ok, there are german messages but someone might have a little bit personalized ones - maybe telling callers the company name before asking them to dial the extension if they know it. Making custom messages is not the problem - but how to upload and in which sound/data format?
    - caller ID: my ISP told me that he transfers the caller ID correctly to analoge end devices if caller ID is available and not suppressed. All I can see when a call comes in is which FXO Port is being used by that call. So callback entries on the SPA phone is senseless. Any advise?
    - CLI: You can telnet the device - but which credentials to use to successfully logon? The pre-assigned credentials form Cisco AT are not accepted for logon.
    BTW @Cisco guys: I am also voting for support for the older SPAs (e.g. 942)

    Hi Claus,
    Thanks for giving the UC320W a spin and glad you found the support community!  Let met see if I can help answer your questions....
    Time/Date & NTP -- The UC320W is preconfigured with Cisco's Small Business NTP server.  The preferred method for correct time you will need the UC320W WAN to be connected with Internet access.   If there is no WAN connectivity there is a feature in the 2.1.x firmware where you can set the time on a SPA phone GUI and it will then update the system time.  Alternatively, if you have a LAN side NTP server that is on the same subnet as your Data VLAN subnet, you can use the NTP.pmf file found here:  https://supportforums.cisco.com/docs/DOC-16301
    Upload custom Music on Hold and Auto Attendant prompt files.  We are currently in beta of a new Cloud service.  To participate in the Beta, please send an e-mail to [email protected] requesting MoH/AA Custom files Cloud Beta participation.
    Caller ID on FXO:  Make sure that you have run the impedance matching tool on each of your FXO ports.  For additional information on running the Impedance Matching tool and Caller ID troubleshooting, please see the UC320W Troubleshooting Guide.
    CLI access -- This is for Cisco Support personnel only for low level debugging.  This is not a IOS based device and there is no command line access for provisioning.
    Cheers,
    Chris

  • How To Include Current Time and Date in Form

    Does anyone know how I can include the time and date in the
    body of a form mailer? Our system allows the receiver of each
    submitted form to copy the body of the form entries and paste them
    into either Excel or FileMaker for database building. They would
    like to have the time and date also appear somewhere in the
    submitted body so they will not have to do a seperate copy/paste of
    the time and date seen in the header... I followed the javascript I
    found in the Adobe website and included it within the form, but
    when I ran a test nothing showed! Here is the form...
    Click
    Here to see the Form
    Thanks for your help! -D

    Can you not use when the email's timestamp?
    Also, in z7's script, beware the common mistakes, if you try
    to retype it - .getDate() gives the day of the month (1-31), but
    .getDay() gets the day of the week (1-7). To make it more
    confusing, .getMonth() gets the month (0-11), so you have to add
    one to make it human-readable. The script posted is correct, but I
    went round and round with my PC when I tried to do that the first
    time!

  • Extract time and data with a regular expression

    Hi,
    I have a string with time and date in a HTML statement.
    String s =">19:59, 18 August 2006</a> ";
    // I hope get
    String s1="19:59, 18 August 2006";or
    String s =">18:37, 4 September 1998</a>"Because of different length of months, so how use regular expression to extract it.
    The second question is how to write the string into a file.
    filename =  "A.txt";
                    File file = new File(filename);
              out=new BufferedOutputStream(
                        new FileOutputStream(file));
                   byte[] buffer = new byte[1024];
    // then what?Thank you in advance!

    If "WARNING" can never occur in the input then wedon't have to worry about making the regex not match
    it.
    Hmm, how about fool-proof? :)Bad idea, and impractical or impossible to implement. Excessively defensive coding leads to bloated, hard to maintain code, and a greater likelihood of bugs.
    Code so that you code works correctly provided the preconditions are met. It's the caller's responsibility to meet them. Don't waste time and gunk up your code trying to handle inputs that aren't allowed to occur.

  • Capturing system time and date and the time difference and date difference.

    Hello Experts,
    i have a requirement the i need to capture select query start time and date as i runthe program on midnight (ie) 11:55 p.m.
    I tried system fields sy-datum and sy-uzeit for capturing the system date and time when my program runs but it gets reset when the date changes.
    i tried get time field option but it is resetting the sy-datum to zero so i am able to capture the date of the next day and resulting in wrong calculation of time .
    please help with your valuable answers.
    Thank you,
    Srinivas.

    Hi,
    As per my understanding you want to fetch those data which are created between the program last run date time and current date time.
    If I am right please follow the below procedure.
    1. Create one custom table to store program name and program execution last date time
    2. at event INITIALIZATION populate to fields date and Time using the statement sy-datum
    initialization.
      v_curr_time = sy-uzeit.           " Current time
      v_curr_date = sy-datum.           " Current date
    3. Get the last run date and time from the above custom table.
    4. Do your logic.
    5. at last Update the custom table with current date and time based on the step two (Here do not take sy-datum like that, take the value in the global variable populated in step 2)
    Thanks
    Subhankar

  • How to get System time during report generation?

    Hi,
    I am developing a template in which I am required to show data of current year only. Is there any method by which I can get system time(from which I will extract year) ?

    Thanks,
    I already have found it on page 260 of oracle bi publisher guide.
    sysdate() <?xdofx:sysdate()?> SYSDATE returns the current date and time.
    The datatype of the returned value is DATE.
    The function requires no arguments.

Maybe you are looking for