Is timesync still required for Windows Server 2012 R2?
Windows has a built-in function to do time synchronisation. And by default it gets the time from time.windows.com
. There is no need to use a third-party application.
You can (but you should not need to) change the settings by right-clicking the clock in the taskbar > Adjust date/time
> Internet Time
.
Or from the command line:
w32tm /config /syncfromflags:manual /manualpeerlist:time.windows.com /update
Related videos on Youtube
ThaCoder
Updated on September 18, 2022Comments
-
ThaCoder almost 2 years
I have a database that looks like this:👇👇
images 🌅
| id | name | src | status | | ------------- |---------------| ------------| ----------| | 1 | nice sun set | 1020288.jpg | published | | 2 | poor sun set | 1120288.jpg | published | | 3 | best sun set | 3120288.jpg | deleted | | ------------- |---------------| ------------| --------- |
image_views 👀
| id | image_id | browser_id🌎 | created_at | | ------------- |---------------| ------------ | ------------------ | | 1 | 2 | 1020288e3221 |2020-02-23 13:55:11 | | 2 | 1 | 1120288221ww |2020-02-27 13:50:51 | | ------------- |---------------| ------------ | ------------------ |
Now in my laravel App,
I want to get the most viewed image in the PAST last 7 days.
( i want to have a column of image_views and those views 👀 should be grouped by browser id ).
so here is what i have tried:👇👇
$image_views = DB::table('image_views') ->selectRaw('count(*) as view_count') ->where(function($query){ $query->where('image_views.image_id', 'images.id'); $query->whereDate('image_views.created_at', '>=', Carbon::now()->subDays(7)->toDateTimeString() ); }); $image = Image::select(['images.*', DB::raw('(' . $image_views->toSql() . ') as views ')]) ->limit(1) ->orderBy('views', 'desc') ->where('images.status','published') ->mergeBindings($image_views) ->get(); return $image;
So unfortunately the posted above☝☝ code does not work😩
It only return blank results.
By the way i have lot of views in image_views table starting from 2⃣0⃣1⃣9⃣ to now, just that i couldn't post all here..
THE FUNNY THING IS THAT IF I CONVERT IT TO SQL AND PASTE IT IN PHPMYADMIN IT WORKS LIKE A CHARM
return $image->toSql(); //->mergeBindings($image_views) //->get();
PLEASE SOMEONE TELL ME WHAT I AM DOING WRONG IN LARAVEL!!🙌
-
joeqwerty about 10 yearsThe
Windows Time Sync
that you're referring to is only applicable to domain joined clients in a Windows AD domain. If you're not running a Windows AD Domain then yes, you'll need to continue to use TimeSync. This isn't new to Windows Server 2012R2. -
joeqwerty about 10 yearsTechnically you could use the Windows Time Service but you'd have to manually configure it on all of your workstations and the server. Again, this isn't new to Windows Server 2012R2.
-
myron-semack about 10 yearsBy "TimeSync", are you referring to a third-party piece of software? Or do you mean the built-in Windows Time Service?
-
impossible about 10 yearsYes, a third party windows service to keep the clock updated. So the Windows Time won't keep the clock updated automatically it seems. I'll go ahead and put TimeSync on Windows again. Thx
-
myron-semack about 10 yearsEvery version of Windows since XP has a built in NTP client that will keep the clock synced over the Internet. If the Windows Time Service is not working for you, it is probably misconfigured. You should probably fix that rather than load an unnecessary third-party application.
-
Akina over 4 yearsI want to get the most viewed image in the PAST last 7 days. Only ONE? Or one per some group? If there is 2 or more images with the same max. views amount - do you need in all, or only one of them? Anycase solve this task using pure SQL at first...
-
Foued MOUSSI over 4 yearsCould you plz add your Image and ImageView models ?
-
ThaCoder over 4 yearsi want only 1 image results whether they are equal or not. and yes it is working in pure
sql
the problem is implementing inLARAVEL
. -
ThaCoder over 4 years@Foued MOUSSI they are empty that's why i did not add them
-
-
myron-semack about 10 yearsHow to configure the Windows Time Service: technet.microsoft.com/en-us/library/cc773263(v=ws.10).aspx