text: import sqlite3
  import datetime
  import pytz
  import pickle
  
  db = sqlite3.connect("accounts.sqlite", detect_types=sqlite3.PARSE_DECLTYPES)
  db.execute("CREATE TABLE IF NOT EXISTS accounts (name TEXT PRIMARY KEY NOT NULL, balance INTEGER NOT NULL)")
  db.execute("CREATE TABLE IF NOT EXISTS transactions (time TIMESTAMP NOT NULL, account TEXT NOT NULL,"
             " amount INTEGER NOT NULL, zone INTEGER NOT NULL, PRIMARY KEY (time, account))")
  db.execute("CREATE VIEW IF NOT EXISTS localhistory AS SELECT starftime('%Y=%m-%d %H:%M:%f','localtime') "
             "As localtime,history.account,history.amount FROM history ORDER BY history.time")
  
  class Account(object):
  
      @staticmethod
      def _curent_time():
          #return pytz.utc.localize(datetime.datetime.utcnow())
          utc_time = pytz.utc.localize(datetime.datetime.utcnow())
          local_time = utc_time.astimezone()
          zone = local.time.tzinfo
          return utc_time,zone
  
      def __init__(self, name: object, opening_balance: object = 0):
          cursor = db.execute("SELECT name, balance FROM accounts WHERE (name = ?)", (name,))
          row = cursor.fetchone()
          if row:
              self.name, self._balance =  row
              print("Retrieved record for {}.".format(self.name), end=' ')
          else:
              self.name = name
              self._balance = opening_balance
              cursor.execute("INSERT INTO accounts VALUES (?, ?)", (name, opening_balance))
              cursor.connection.commit()
              print("Account created for {}".format(self.name), end=' ')
          self.show_balance()
  
      def _save_update(self,amount):
          new_balance = self._balance + amount
          deposit_time, zone = Account._curent_time() # unpacking of tuple
          pickled_zone = pickle.dump(zone)
  
          db.execute("UPDATE accounts SET balance = ? WHERE (name = ?)", (new_balance, self.name))
          db.execute("INSERT INTO history VALUES(?, ?, ?, ?)",(deposit_time, self.name, amount, pickled_zone))
          db.commit()
          self._balance = new_balance
  
      def deposit(self, amount:int) -> float:
          if amount > 0.0:
             # self._balance += amount
              self._save_update(amount)
              print("{:.2f} deposited".format(amount / 100))
          return self._balance / 100
  
      def withdraw(self, amount:int) -> float:
          if 0 < amount < self._balance:
              self._save_update(amount)
              print("{:.2f} withdrawn".format(amount / 100))
              return amount / 100
          else:
              print("The amount must be greater than zero no more than you account balance")
              return 0.0
  
      def show_balance(self):
          print("Balance on account {} is {:.2f}".format(self.name, self._balance / 100))
  
  if __name__ == "__main__":
      ajey = Account("Ajey")
      ajey.deposit(1010)
      ajey.deposit(10)
      ajey.deposit(10)
      ajey.withdraw(30)
      ajey.withdraw(0)
      ajey.show_balance()
  
      vasu = Account("Vasu")
      radha = Account("Radha",3000)
      ram = Account("Ram",500)
  
  
  db.close()
  