Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- System.Globalization.CultureInfo culture = new System.Globalization.CultureInfo("en-GB"); // UK date format (DD/MM/YY)
- string dateAndTime = System.DateTime.Now.ToString(culture); // Get date and time (DD/MM/YY hh:mm:ss)
- string date = dateAndTime.Split(' ')[0]; // Get just date
- string fileNameFriendlyDate = date.Replace('/', '-'); // Replace '/' with '-' because '/' is used for file path
- Debug.Log(fileNameFriendlyDate); // Output: "16-11-2017"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement