Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Reports Module Sql selct stament problem with timeReports Module Sql selct stament problem with time
Previous
 
Next
New Post
2/9/2014 11:31 PM
 
Hi everybody. I am using the reports module to show a list of the last users who logged in. The only problem is that I am using a cloud server which is located in a different time zone so the times are always off. How can I correct this? My code is as follows:
Select
AU.Username,
U.FirstName,
U.LastName,
AM.loweredEmail as Email,
AM.LastLogindate as 'Date, Time is around 5 hours behind'
from
aspnet_Membership as AM with (nolock)
join aspnet_Users as AU with (nolock) on AM.UserID = AU.UserID
join Users as U with (nolock) on U.UserName = AU.Username
where
AM.ApplicationID = (select ApplicationID from dbo.aspnet_Applications where ApplicationName = 'DotNetNuke')
ORDER BY AM.LastLoginDate DESC
 
New Post
2/10/2014 3:33 AM
Accepted Answer 
instead of AM.LastLogindate you should be able to use
DateAdd(hour, 5, AM.LastLogindate) as LoginDate

Cheers from Germany,
Sebastian Leupold (Microsoft MVP)

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
2/10/2014 4:08 AM
 
Thank you Sebastian Leupold you always come through1
 
New Post
2/10/2014 4:51 AM
 
Note: the solution above does not take into account DST variations, e.g. if you are in Europe and your server is located in the U.S., there might be 1h difference in March and November, when the U.S. is on DST, while Europe switched back/remained in Winter time.

Cheers from Germany,
Sebastian Leupold (Microsoft MVP)

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
2/10/2014 5:11 AM
 
i changed the 5 to a -5 and were all good
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Reports Module Sql selct stament problem with timeReports Module Sql selct stament problem with time


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.

Content Layout

Subscribe to DNN Digest

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out