Time format in hh:mm:ss

SL922

Active Member
I need to convert the time from format hhmmss to hh:mm:ssAM or hh:mm:ssPM
I used B9800188 (input as 784 and 0 for formatMode) which converts the time 784 to 00:07:59 not 07:08:04
but this function is correct if the time is 141310, it converts to 14:13:10
Is anybody aware of this problem?
Does anybody know how to convert the 784 to correct time or aware of any existing bsfn which can convert this?

Thanks advance for any input
E910 TR 9.1.2.2 SQL 2008 R2
 
The functions need the time in 6 digit format. If you just pass 8 for example and expect that to be 8:00:00, how would the system know that you didn't want 00:00:08 (which is what it will produce) 784 is 070804
 
Do you know any way to convert this 3 digits to 6 digits format?
Is there any function will take the format as is?
Do you have any suggestion to convert this format?
Thanks
 
If your input is always going to be three digits, you can use standard string functions in ER code to convert 784 to 07:08:04, right? May be I did not understand your question correctly.
 
[ QUOTE ]
I used B9800188 (input as 784 and 0 for formatMode) which converts the time 784 to 00:07:59 not 07:08:04

[/ QUOTE ]

[ QUOTE ]
Do you know any way to convert this 3 digits to 6 digits format?

[/ QUOTE ]

I don't understand how that 3 digit format works, what do you enter to get 13:43:15 or 01:43:15 pm
 
I have been watching this thread for a little bit. I somewhat confused because the 3 digit time number isn't a JDE time format or another time format that I am aware of. If it's not a JDE or other familiar time format I am sure there won't be a business function to convert it.

The JDE time value such as what is in UPMT is coded as hhmmss in a number field. If there are preceding zeros they are not shown since this is a number field. 12:07:48a would be 748, 1:48:13am would be 14813, 8:06:03pm would be 200601.

Where is this 3 digit time value coming from?
 
[ QUOTE ]
Where is this 3 digit time value coming from?

[/ QUOTE ]

I'm wondering the same thing myself.

And furthermore, I'm pretty sure there is no standard JDE bsfn for this.
 
3 digits time is from java code of
--
Calendar date = Calendar.getInstance();
int minute = date.get(Calendar.MINUTE);
int hour = date.get(Calendar.HOUR_OF_DAY);
int second = date.get(Calendar.SECOND);
String StringTime = String.valueOf(hour) + String.valueOf(minute) + String.valueOf(second);
--
 
What is the source of the java code? In other words, who wrote it? Is it from a standard E1 BSSV? If not, you should be requesting from the author of that code that the time format complies with the E1 time format.

There is no universal way to programmatically 'know' what the digits represent in terms of hours, minutes, or seconds. The combinations are too abundant to try to code for. That is why a strict time format is used...so there is no ambiguity.

Your java code needs to provide an E1 time format. The output of that java code is useless in any framework (no offense to whoever created it), not just E1.
 
Yes, there are 2 solutions to reformat the time in the BSSV Java code to E1 Time format as hhmmss. Yes, the solution is change the original input value. Thanks for all of your input.
 
Yep, that's not a standard time format, its custom. That's why we were all confused and why there isn't a standard function to convert it.
 
The function AcmeFormatDateTime (See attached) formats both a jde date and a jde time into one string, but could be modified to return the time piece as a separate return parameter.
 

Attachments

  • 183226-b5800034.zip
    5.4 KB · Views: 166
Oh, strangely enough, and I couldn't find a standard function either Scott, which is why I had to roll my own. You would think that at some point JDE would have needed to display a time value.
 
Hi @BOster, would you be able to re-post the AcmeFormatDateTime function, i am seeing SDTDAY values 134879 where the last 2 digits are confusing
 
Back
Top