Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8594071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:07:16+00:00 2026-06-12T00:07:16+00:00

I am working with SoupUI a i need to adjust a Date/time (UTC) that

  • 0

I am working with SoupUI a i need to adjust a Date/time (UTC) that i get back in a response to a GMT Date/time. The date that i get back in the respone looks as followes:

2012-11-09T00:00:00+01:00

I would like to convert this to

2012-11-08T23:00:00Z

Unfortunatly i lack Java skils and therefore also Groovy skils to be able to do this on my own. i did a lot o searches on date convertions but until now i was still unable to find what i was looking for. i will keep searching. if i do manage to get the solution then i will post it here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T00:07:17+00:00Added an answer on June 12, 2026 at 12:07 am

    Assuming there isn’t a colon in the timezone portion, I believe this should work:

    // Your input String (with no colons in the timezone portion)
    String original = '2012-11-09T00:00:00+0100'
    
    // The format to read this input String
    def inFormat = new java.text.SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssZ" )
    
    // The format we want to output
    def outFormat = new java.text.SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss'Z'" )
    // Set the timezone for the output
    outFormat.timeZone = java.util.TimeZone.getTimeZone( 'GMT' )
    
    // Then parse the original String, and format the resultant
    // Date back into a new String
    String result = outFormat.format( inFormat.parse( original ) )
    
    // Check it's what we wanted
    assert result == '2012-11-08T23:00:00Z'
    

    If there is a colon in the TimeZone, you’ll need Java 7 for this task (or maybe a date handling framework like JodaTime), and you can change the first two lines to:

    // Your input String
    String original = '2012-11-09T00:00:00+01:00'
    
    // The format to read this input String (using the X
    // placeholder for ISO time difference)
    def inFormat = new java.text.SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ssX" )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working with a Lucene index, I have a standard document format that looks something
Working with an undisclosed API, I found a function that can set the number
Working with H2 I get this error when I try to write a row
Working with MS Access for the first time and coming across a few problems
Working on an extension that use the new experimental devtools apis. How do you
Working with an API where I need to send a value over in an
Working with liferay it's always says about portal in response: Liferay-Portal:Liferay Portal Community Edition
working on xcode I realized that if I create a non-void method, I call
Ive been trying to get an example Web Service working using SpringWS and Tomcat5.5
Working with C#. I have an abstract class that I use to read/write settings

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.