Santa Barbara and San Diego can be reached within two hours from Sacramento. 
If you want to explore other coastal cities, tranquil seaside Santa Barbara to the north and sunny but bustling San Diego to the south can both be reached in about two hours from Los Angeles.