Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Java Time Calculation: 12:00pm to 1:30pm returns as 1.5

New Here ,
Jan 24, 2022 Jan 24, 2022

Hi There,

 

I'm trying to create a timesheet in Adobe, but HR requires that the hours be submitted in decimal format rounded to the nearest quarter (ex. 1 hour 30 minutes of work is ti be submitted as 1.5.) However, the times nust be entered in H:MM tt format. Picture included for reference. 

 

Any ideas/solutions?

 

Thanks, 
TimAdobe Example.jpg

TOPICS
Create PDFs , How to , JavaScript
732
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 24, 2022 Jan 24, 2022

In the past, I used a way to count for 100 minutes per hour then convert it back to 60 to display results.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 25, 2022 Jan 25, 2022

How did you do that?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 24, 2022 Jan 24, 2022
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 25, 2022 Jan 25, 2022

Thanks, but this didn't get me any further.

 

All I need is for 1h 30m to return as 1.5h

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 25, 2022 Jan 25, 2022

In your calculation just divide minutes by 60 and then add result to  hours,

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 31, 2022 Jan 31, 2022

I don't understand what you mean, I'm sorry.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 31, 2022 Jan 31, 2022
LATEST

All I need is for 1h 30m to return as 1.5h

To get decimal from time, divide minutes by 60, you need to implement this into your script where you calculate total time.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines