Unity-Technologies / GenericFrameRecorder

This GitHub package is DEPRECATED. Please get the new Unity Recorder from the Asset Store (https://assetstore.unity.com/packages/essentials/unity-recorder-94079) Use the editor builtin Bug Reporter to report issues. You can track and vote for issues on the Issue Tracker (https://issuetracker.unity3d.com)
MIT License
534 stars 66 forks source link

[Recorder] Date atribute in file name is formatted by US locale instead of user's machine locale #61

Open Justiss50 opened 6 years ago

Justiss50 commented 6 years ago

To reproduce:

  1. Download recorder package
  2. Set it up and set file name to have Date stamp
  3. Record and see resulting file name - it will ignore set locale or date setting

Expected: file name will have date format that is on user machine Actual: file name always has date formatted by US locale

Reproduced: 2017.1.2p4, 2017.2.1p1, 2017.3.0p2, 2018.1.0b2, 2018.2.0a1

Tested on: Windows 10, OSX 10.13

jasonm-unity commented 6 years ago

date is generated using the .net library's ToShortDateString() doc quote: The string returned by the ToShortDateString method is culture-sensitive. It reflects the pattern defined by the current culture's DateTimeFormatInfo object. For example, for the en-US culture, the standard short date pattern is "M/d/yyyy"; for the de-DE culture, it is "dd.MM.yyyy"; for the ja-JP culture, it is "yyyy/M/d". The specific format string on a particular computer can also be customized so that it differs from the standard short date format string.

But, '/' are converted to "-" since '/' is an invalid file name character. Can you provide specific examples of local settings vs output file name?

Justiss50 commented 6 years ago

Hi,

Image attached :) If you need someting else, poke me on slack(@justinasp)

2018-01-17 18:11 GMT+02:00 jasonm-unity notifications@github.com:

date is generated using the .net library's ToShortDateString() doc quote: The string returned by the ToShortDateString method is culture-sensitive. It reflects the pattern defined by the current culture's DateTimeFormatInfo object. For example, for the en-US culture, the standard short date pattern is "M/d/yyyy"; for the de-DE culture, it is "dd.MM.yyyy"; for the ja-JP culture, it is "yyyy/M/d". The specific format string on a particular computer can also be customized so that it differs from the standard short date format string.

But, '/' are converted to "-" since '/' is an invalid file name character. Can you provide specific examples of local settings vs output file name?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Unity-Technologies/GenericFrameRecorder/issues/61#issuecomment-358354384, or mute the thread https://github.com/notifications/unsubscribe-auth/AgomqvbbUOQ_nhTMRpVGX8crCslLjdZrks5tLhu5gaJpZM4Rcfgb .

kwi-dk commented 5 years ago

For a filename, I'd recommend we stick to some variant of ISO 8601 (i.e. date.ToString("yyyy'-'MM'-'dd'")). This ensures that filenames sorts correctly in file lists. It's also locale-independent... and arguably, a file name is a bad place for locale sensitivity (it's not like it gets magically renamed when it's later copied to a computer with another locale setting).