Python tutorial - Python Datetime - Usage - How to use Datetime in python

preview_player
Показать описание


#python #pythonprogramming #pythontutorial #pythonforbeginners #youtubechannel #pythonbeginner #pythonosmodule #import #pythonprogrammingimportosmodule #pythonprogrammingosmodule #pythontutorialfree #pythonyoutube #pythondatetime #pythondate #pythonimportdatetime
#python #pythonprogramming #pythontutorial #pythonforbeginners #youtubechannel #pythoninstallationcomplete #pythonhowtoinstall #pythoninstall #pythondownload #pythontutorialfree #pythonyoutube #pythonenglish #pythonenglish

------------------------------------------------------Transcript--------------------------------------------
hello welcome to technology platform so today we are going to see the date and time format how to use date and time let me open idle cell now so already we have seen that uh OS topics now we can see import date and time format how we are going to use it let's see now so normally in the command prompt you already used so how to display the date and time but here we have to use it import statement and then you have to type a date time and then you have to use print date time Dot just wait for sometimes again date time Dot and then now so like this you need to display the date and time what is the date and time like this you need to display like this it's it's something like white we need to do some process and then we need to use it like now you want to use it current date you want to pull it now let's see import date time and then print date time Dot date dot today it should display like current date what is the current date like that it would display there is no time only date now you can also pass the values in the date and then you can display here let's see now import date time print date time dot date Open Bracket now here and today date is like 3rd August I'll type it like 8 month and then third now let's see

okay so 0 we should not use it because of that it is giving an error message you can use it like without zero

3 is also not allowed yeah foreign

[Music] close bracket now you can see this 2023.08 and 0 3 so like this you can also pass the value here um and one more also you can do it here now we are using directly right so import date and time like that now I want to use it I don't want to use like date time date time dot dot like that I have to use it like date dot today and then it should display for example I'll show you here import date time print and then date start today I need to display it should display but here you will get an error message because there is no valid something like this right now let me close it and open again

that's fine

so now how we have to achieve this let's see now

I'll say like I don't want to use from now from date time import date and then print now you can type it only date dot today

let's see you're able to achieve it so you have to use it like this so one more thing is also we can try import date and then you can type it import

date and from date time whether it is working or not let's see so here itself you are getting an error message so this is not correct right so how you are going to use it like from and then import so that is the command prompt you have to use it so like that you are getting the time now you want to use it um how we can say like

this is we have seen it and date time is also you have seen it now let's see how to display the year month day separately like that let's see now

I'm going to use it again from date time import date or else you can use it only

or else you can use it only input date time print date time Dot

date dot today

anything you are able to see it here here something like that here are not getting right now let's see like this you're not getting now what I am going to do here is that instead of printing I have to store it in a variable Str today

now date time dot today let's see Str today I printing so it is displaying like this 2023 8 like that you are getting a message now see this I want to display like Str today Dot yeah like that I will check I am getting Str today Dot month eight Str today Dot eight I'm getting like this so I am going to write it like in a one command import date time Str today date time dot date dot today and then now you can say like Str today dot here Str today dot month Str today dot day now you are able to see so this kind of separate you have to separate it year month like that you can see it so this is enough because uh it's having more part one part two we have so c one by one okay thank you bye
Рекомендации по теме
welcome to shbcf.ru