how to caclulate the currenttime what is the iso week number in china

深圳前海深蕾半导体有限公司 深圳前海深蕾半导体有限公司
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 17, 2024

 

 

such as in china the time 2024-11-17 in our jira  system is the 47th week , but actually in china is the 46th week . 

 

1 answer

0 votes
Humashankar VJ
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 18, 2024

Hi @深圳前海深蕾半导体有限公司 深圳前海深蕾半导体有限公司 

Please make use of the below Python code, which will work the best for the requirement

  1. from datetime import datetime
    import pytz
  2. # Define the timezone for China
    china_tz = pytz.timezone('Asia/Shanghai')
  3. # Get the current date in China timezone
    current_date = datetime.now(china_tz)
  4. # Calculate the ISO week number
    iso_week_number = current_date.isocalendar()[1]
  5. print(f"The current ISO week number in China is: {iso_week_number}")

Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events