kif1205 / Python

0 stars 0 forks source link

Change linux Date function #32

Open kif1205 opened 5 years ago

kif1205 commented 5 years ago

def tc_Misc_00005(): case = ["test"] SYS_SetTestCaseName(case)

Test_Day_Count = 3

print_log("Current Date is : " + SSH_Write("date")[0])
Current_Year = SSH_Write("date +%Y")[0][:-1]
Current_Month = SSH_Write("date +%m")[0][:-1]
Current_Day = SSH_Write("date +%d")[0][:-1]

if len(Current_Month) == 1:
    Current_Month = "0" + Current_Month

Test_Days = str(int(Current_Day) + Test_Day_Count)
if len(Test_Days) == 1:
    Test_Days = "0" + str(Test_Days)    

SSH_Write("date " + Current_Month + Test_Days + "1200" + Current_Year)

print_log("Current Date is : " + SSH_Write("date")[0])