1

I am trying to generate Excel report of Employee Schedule Times in a week.

I have one function which calculate total hours and mins in a week and will return in format Hours:Mins.

I am displaying total hours in excel. The issue here is after 24:00 total time i.e if the total time is 25:00 it is printing in Excel as 25:00:00.

I want it to be 25:00 instead. I don't understand the issue.

Can any one please help me on this?

5
  • 2
    Which Excel framework library are you using? Commented May 15, 2013 at 10:07
  • And what number format masking ar eyou applying to that calculated cell? Commented May 15, 2013 at 10:13
  • header("Content-type: application/vnd.ms-excel"); header("Content-Disposition: attachment; filename=EMP_ScheduleReport_excel.xls"); Commented May 15, 2013 at 10:22
  • i am using Content-type:application/vnd.ms-excel Commented May 15, 2013 at 10:35
  • headers and content type don't automagically create an excel file.... how are you generating the actual excel data that you send to the browser to go with those headers Commented May 15, 2013 at 12:41

1 Answer 1

1

How are you creating the excel file? Is it just a csv/tab delimited? If so then no date formatting is applied to the cells, which is the problem.

If you want to apply date formats etc. to cells using PHP, I would suggest using something like the PHPExcel library.

Sign up to request clarification or add additional context in comments.

2 Comments

i am creating by using Content-type:application/vnd.ms-excel.
can you post the exact code you are using to create the excel file?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.