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 » General IBM MQ Support » HH:MM:SS:ss

Post new topic  Reply to topic
 HH:MM:SS:ss « View previous topic :: View next topic » 
Author Message
bobbee
PostPosted: Mon Jul 13, 2009 2:49 pm    Post subject: HH:MM:SS:ss Reply with quote

Knight

Joined: 20 Sep 2001
Posts: 545
Location: Tampa

I have the MQ C API exit. I want to print out the time as HH:MM:SS:ss

Anyone have an example?
Back to top
View user's profile Send private message Send e-mail AIM Address
gbaddeley
PostPosted: Mon Jul 13, 2009 5:22 pm    Post subject: Re: HH:MM:SS:ss Reply with quote

Jedi Knight

Joined: 25 Mar 2003
Posts: 2538
Location: Melbourne, Australia

bobbee wrote:
I have the MQ C API exit. I want to print out the time as HH:MM:SS:ss

Anyone have an example?


strftime() is your friend. eg.

Code:
time_t now;
char buf[32];

 time( &now );  /* Get current time in GMT seconds */
 strftime( buf, sizeof(buf), "%H:%M:%S", localtime(now) );


If you want to handle fractions of seconds you will need to calculate them and append a decimal string. eg.

Code:

int fracsecs;

  sprintf( buf+strlen(buf), ":%02d", fracsecs );


QED
_________________
Glenn
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » HH:MM:SS:ss
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.