mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-25 16:15:55 +03:00
[GH-ISSUE #1944] HAR Export on 12h Time Produces Incorrect Timestamps #1934
Labels
No labels
Discussion
Feature request
In Progress...
Plugins
Waiting response
Windows
Windows
bug
duplicate
enhancement
feature
good first issue
iOS
macOS 10.11
question
wontfix
✅ Done
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Proxyman#1934
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SimonRice on GitHub (Feb 22, 2024).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1944
Originally assigned to: @NghiaTranUIT on GitHub.
Description
It seems like that if I have my time format set to 12h & I export an HAR file between 1AM & 10AM or between 1PM & 10PM, the timestamps are incorrectly formatted, missing a leading
0in the hour component.As a result, the file can't be opened with Charles Proxy, and possibly other apps. Interestingly, Proxyman can still read the file correctly!
Steps to Reproduce
I do have an HAR file of a couple of Google request-response pairs I made with Proxyman that you're also welcome to use.
Current Behavior
The resulting HAR file imports in to Charles Proxy correctly.
Expected Behavior
The resulting HAR file fails to import in to Charles Proxy. It shows there's an issue with the timestamp(s).
Manually editing the timestamps via search/replace makes the file compatible with Charles Proxy again.
Environment
@NghiaTranUIT commented on GitHub (Feb 23, 2024):
Thanks @SimonRice , let me fix it 👍
@NghiaTranUIT commented on GitHub (Feb 28, 2024):
@SimonRice it's odd that I can't reproduce it 🤔
Currently, Proxyman uses this format
yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZto generate thestartedDateTimeYou can find this HAR Log:
Apps_02-28-2024-14-23-00.har.zip
The
startedDateTimeformat is correct and it doesn't affect by theUse 12h formatOption in the Setting.Can I ask if this bug still happen if you use
24h mode?@NghiaTranUIT commented on GitHub (Feb 28, 2024):
even though I force the UK timezone in the TimeFormatter, it still has the leading
0HAR:
@SimonRice commented on GitHub (Feb 28, 2024):
Hi @NghiaTranUIT,
First of all, thank you so much for the reply.
I tried the above for a command line app, based on what you gave me:
With this sample, it does print out
2024-02-28T07:46:55.000Z.However, if I leave / comment out
formatter.locale = Locale(identifier: "en_GB")it does not print out correctly - this prints out2024-02-28T7:46:55.000Z.Bizarrely, if I print out the formatter's locale's identifier within the body of
iso8601without setting the formatter's locale, I geten_GB@calendar=iso8601. Whereas with the formatter's locale set, that's understandablyen_GB. I do wonder if usingen_US_POSIXwill do the trick here!If it helps at all, I've attached my date & time and language & region settings here.
Finally, if I do set my time setting to 24h, I do get a leading zero with your above sample and with the local setting commented out.
I hope this all helps.
@NghiaTranUIT commented on GitHub (Feb 28, 2024):
Nice, I realize my original implementation is:
It means it somehow changes the behavior of the
dateFormatstring. Let me investigate it.May I ask:
Set your time format to 12 hour & ensure your time is either between 1AM & 10AM or between 1PM & 10PM.Do you mean the 12 Format in Proxyman -> Setting -> Advance Tab -> Use 24h format ?
Or the System Time Format (Date & Time) ?
@SimonRice commented on GitHub (Feb 28, 2024):
I did mean system format - however, on Proxyman's advanced tab, it's switched off as well.
@NghiaTranUIT commented on GitHub (Feb 29, 2024):
@SimonRice can you try this build: https://download.proxyman.io/beta/Proxyman_5.0.0_Try_to_fix_the_ISO_8601.dmg
I use
ISO8601DateFormatterrather than DateFormatter with a custom dateString.ISO8601DateFormatterdoesn't allow to have the time zone, it always use UTC and we should not override with current timezone or locale.I test and it works on my end 👍
@SimonRice commented on GitHub (Feb 29, 2024):
Thank you so much for this @NghiaTranUIT - this works perfectly 🎉
@NghiaTranUIT commented on GitHub (Mar 1, 2024):
Awesome 👍
@SimonRice commented on GitHub (Apr 23, 2024):
The amend in question is still working brilliantly 🎉 I've been meaning to close this issue for ages, so I'll do that now! Thank you @NghiaTranUIT once again for your brilliant support!