getlastlogindatetime

Certified Senior Developer

Hi All

I am using getLastLoginDateTime function which is in the below plugin

 Get Last Successful Login Details 

But facing weird issue. 

below are the code snippet

It is working fine without typecase but while typecast it is showing error
Note :- loginDateTime has date and time data type and it is not working for 2-3 users and for rest it is working fine even while typecast.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Problem is with what getlastlogindatetime() function is returning. Its returning time in 24 hour format but for some reason, it is appending AM/PM after each result as 24 hour time format is represented without AM/PM.

    That's why it couldn't be converted to datetime. So, it will throw error if user's login time is at or after 1 pm. One solution would be to convert 24 hour time to 12 hour.

Reply
  • 0
    Certified Senior Developer

    Problem is with what getlastlogindatetime() function is returning. Its returning time in 24 hour format but for some reason, it is appending AM/PM after each result as 24 hour time format is represented without AM/PM.

    That's why it couldn't be converted to datetime. So, it will throw error if user's login time is at or after 1 pm. One solution would be to convert 24 hour time to 12 hour.

Children