Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2017
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do we convert to ISO date?

    How can I convert the following to an ISO date, i.e., 2017-03-25

    Code:
    $dpday = $_POST['dpday'];  ---contains  25
    $dpmo = $_POST['dpmo'];   ---contains  03
    $dpyr = $_POST['dpyr'];      ---contains  17
    Thanks

  2. #2
    Banned
    Join Date
    Aug 2017
    Posts
    8
    Thanks
    0
    Thanked 1 Time in 1 Post
    TimeZone tz = TimeZone.getTimeZone("UTC");
    DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'");
    df.setTimeZone(tz);
    String nowAsISO = df.format(new Date());


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •