How to generate a fixed-length hash based on current date and time in Python?

后端 未结 5 602
旧巷少年郎
旧巷少年郎 2021-02-02 17:46

I want to generate a fixed-length (say 10 characters) hash based on current date & time. This hash will be append to names of the uploaded files from my users. How can I do

5条回答
  •  失恋的感觉
    2021-02-02 18:11

    Check out strftime for python. You can format the date/time string any number of ways to get the 'look' you want.

提交回复
热议问题