Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
jaapinho
Regular Visitor

Bad time format on 'startTime', when using REST API Refreshes

Hello,

 

I'm using POWERBI REST API to automate refreshes, with a Python script of mine.

When I check for the last refresh, I use startTime, to know when the last refresh was started.

Most often I get a value as such : yyyy-mm-ddThh:mm:ss.xxxxZ  (xxxx are the microseconds). No problem there...

 

But, every now and then, I get a value as such : yyyy-mm-ddThh:mm:ssZ  (Without the microseconds), which is a different date format.

 

I'm not 100% sure, but it would seem that, when a refresh starts exactly at 0000 microseconds of a second, the microseconds are not included in the data format. I was expecting, in that case, to get a value as such : yyyy-mm-ddThh:mm:ss.0000Z

I had to include a try/except on the script, to manage this situation... but I don't believe it was intended that way.

 

Should I report this as a Bug ?

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Those are milliseconds, not microseconds.

 

Why would you consider that to be a bug?  Both strings are valid ISO8601 datetime strings.

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

Those are milliseconds, not microseconds.

 

Why would you consider that to be a bug?  Both strings are valid ISO8601 datetime strings.

Hi,

Thx for the milliseconds correction.

I wasn't sure it was a bug, hence my question if I should report it as such or not...

For me, it didn't seem normal to receive these different string formats, but I get now from your answer that this is expected... The way I was handling it (Through datetime.strptime) is basically a hack, so I'll be delving into the dateutil library to find a better way. SOLVED.

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.