ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » CASTING issue while adding timezone offset

Post new topic  Reply to topic
 CASTING issue while adding timezone offset « View previous topic :: View next topic » 
Author Message
Rockon
PostPosted: Wed Mar 01, 2017 8:16 am    Post subject: CASTING issue while adding timezone offset Reply with quote

Apprentice

Joined: 24 May 2004
Posts: 43

any hints on the correct format I should be using for casting localtime(without seconds)+timezoneeffect
IIB V9.0.0.6

Code:
DECLARE source CHARACTER  '10:00-5:00';
      DECLARE target TIME;
      DECLARE fmt CHARACTER 'HH:mmZZZ';
      SET target = CAST(source AS TIME FORMAT fmt );
      SET Environment.Variables.target = target;


Error message says
Quote:
Number:INTEGER:3204
Text:CHARACTER:subParse failed
Insert
Type:INTEGER:5
Text:CHARACTER:10:00-5:00
Insert
Type:INTEGER:5
Text:CHARACTER:HH:mmZZZ
Insert
Type:INTEGER:5
Text:CHARACTER:-5:00
Insert
Type:INTEGER:5
Text:CHARACTER:ZZZ
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Mar 01, 2017 8:57 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

"HH:mm-ZZZ"
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Mar 01, 2017 9:15 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

mqjeff wrote:
"HH:mm-ZZZ"




There is a whole section in the documentation that details all the valid format options. It might be a good idea to bookmark it for future reference.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
adubya
PostPosted: Wed Mar 01, 2017 11:51 am    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

Try

Code:

DECLARE source CHARACTER  '10:00-05:00';
      DECLARE target TIME;
      DECLARE fmt CHARACTER 'HH:mmZZZ';
      SET target = CAST(source AS TIME FORMAT fmt );
      SET Environment.Variables.target = target;


Note 5:00 is changed to 05:00

A ZZZ format construct matches "time zone (+/-nn:nn)" leading zeros are significant I believe.
_________________
Independent Middleware Consultant
andy@knownentity.com
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » CASTING issue while adding timezone offset
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.