functions.get_actual_time

 1import datetime
 2import streamlit as st
 3
 4
 5class GetActualTime:
 6    """
 7    Classe com métodos para obtenção e exibição da data e hora atual.
 8    """
 9
10    def get_actual_time(self):
11        """
12        Obtém a hora atual.
13
14        Returns
15        -------
16        hour : str
17            A hora atual.
18        """
19        now = datetime.datetime.now()
20        hour = now.strftime("%H:%M:%S")
21        return hour
22
23    def show_current_time(self):
24        """
25        Exibe a hora atual.
26        """
27        actual_hour = self.get_actual_time()
28        st.info(body="Hora atual: {}".format(actual_hour))
29
30    def get_actual_data(self):
31        """
32        Obtém a data atual.
33
34        Returns
35        -------
36        data : str
37            A data atual.
38        """
39        now = datetime.datetime.now()
40        data = now.strftime("%Y-%m-%d")
41        return data
class GetActualTime:
 6class GetActualTime:
 7    """
 8    Classe com métodos para obtenção e exibição da data e hora atual.
 9    """
10
11    def get_actual_time(self):
12        """
13        Obtém a hora atual.
14
15        Returns
16        -------
17        hour : str
18            A hora atual.
19        """
20        now = datetime.datetime.now()
21        hour = now.strftime("%H:%M:%S")
22        return hour
23
24    def show_current_time(self):
25        """
26        Exibe a hora atual.
27        """
28        actual_hour = self.get_actual_time()
29        st.info(body="Hora atual: {}".format(actual_hour))
30
31    def get_actual_data(self):
32        """
33        Obtém a data atual.
34
35        Returns
36        -------
37        data : str
38            A data atual.
39        """
40        now = datetime.datetime.now()
41        data = now.strftime("%Y-%m-%d")
42        return data

Classe com métodos para obtenção e exibição da data e hora atual.

def get_actual_time(self):
11    def get_actual_time(self):
12        """
13        Obtém a hora atual.
14
15        Returns
16        -------
17        hour : str
18            A hora atual.
19        """
20        now = datetime.datetime.now()
21        hour = now.strftime("%H:%M:%S")
22        return hour

Obtém a hora atual.

Returns
  • hour (str): A hora atual.
def show_current_time(self):
24    def show_current_time(self):
25        """
26        Exibe a hora atual.
27        """
28        actual_hour = self.get_actual_time()
29        st.info(body="Hora atual: {}".format(actual_hour))

Exibe a hora atual.

def get_actual_data(self):
31    def get_actual_data(self):
32        """
33        Obtém a data atual.
34
35        Returns
36        -------
37        data : str
38            A data atual.
39        """
40        now = datetime.datetime.now()
41        data = now.strftime("%Y-%m-%d")
42        return data

Obtém a data atual.

Returns
  • data (str): A data atual.