But mainland desalination plants are connected to the electricity grid.
The problem with only running them part of the time is that the fixed capital and other operational costs of the plant are now split over a smaller amount of water produced so that water is more expensive than if you ran the plant all the time paying more for electricity at other times of the day.